-
Checkbox Control with more complex expression.
Hello there,
I’m trying to enable/disable an expression with the Checkbox Control and can’t get it working. I found a few helpful threads on this forum but I keep getting errors. I think the errors occur due to my mis-handling of the – }else{value}; part of the expression.
Basically, I have this old favourite expression that I’m applying to layers (letters) as they whizz onto screen to form a text super.
// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0){
t = 0;
}else{
t = time – key(n).time;
}
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = .02;
freq = 3.0;
decay = 5.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
But I’d like to disable the expression once the letters have settled so that the keyframed animation I have for when they LEAVE the screen is not affected by the bouncing.
I’ve tried and tried to get it set up correctly, but just can’t do it. Please could I have some help in setting this up?
Many thanks,
James.