-
Need more efficient code for digital clock automation.
So I have been working on making a digital clock in shape-layers to be able to have maximum manipulation-possibilities without having to change every single part individually.
The way it works is:
– Every digit on the clock has 7 layers (shape objects) for every “stroke”.
– The shape of every object is linked to the shape of the first stroke in the first digit so all changes to that one, translates to all other strokes.
– The numbers beneath each digit is a text layer that controls the strokes in every digit:
– Every stroke has an expression (see below) on the opacity to make it turn on/off according to what number should be displayed.So, everything works fine, BUT it is very slow. Even when I don’t play back, my cpu clocks at around 67%.
I really need more efficient code for this, or just a better way to do it so I hope someone can help me out here.My Specs:
AE CS6 on an iMac mid 2010, OS X Lion, intel i5 2,8 GHz, 16GB 1333MGz RAM, ATI 5750 radeon HD 1GB
comp setup: clocksetup.png
below is the code for the opacity expression.if (thisComp.layer("Digit 1").text.sourceText==1)[100]
else if (thisComp.layer("Digit 1").text.sourceText==3)[100]
else if (thisComp.layer("Digit 1").text.sourceText==4)[100]
else if (thisComp.layer("Digit 1").text.sourceText==5)[100]
else if (thisComp.layer("Digit 1").text.sourceText==6)[100]
else if (thisComp.layer("Digit 1").text.sourceText==7)[100]
else if (thisComp.layer("Digit 1").text.sourceText==8)[100]
else if (thisComp.layer("Digit 1").text.sourceText==9)[100]
else if (thisComp.layer("Digit 1").text.sourceText==0)[100]
else [0];