-
Reverse effect of expression
Hi,
I have the following expression:
t = time - inPoint;
startVal = 0;
endVal = 100;
dur = thisComp.layer("Controls").effect("Stretch Duration")("Slider")/10;
if (t < dur){
s = linear(t,0,dur,startVal,endVal);
}else{
amp = (endVal - startVal)/dur;
freq = 3;
decay = 5;
w = freq*Math.PI*2;
s = endVal + amp*Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w;
}
[s,s]As it is, it scales the layer from 0=100 with a slight elastic effect, the duration of the elasticity determined by the slider. I would like to then reverse this effect so that the layer, after a period determined by a slider, returns to 0, again with some elasticity.
Your help will be greatly appreciated.
Thanks