Copy link to clipboard
Copied
I came across this expression under the expression selector under a text layer and when I start offsetting scale, rotation and tracking amount, it has a sort of bouncing effect. I can't figure out how this works (what these lines mean) and would like to learn about this. Any help is greatly appreciated! Thanks!
freq = 2;
decay = 6;
duration = 0.12;
retard = textIndex*thisComp.frameDuration*1;
t = time - (inPoint + retard);
startVal = [100,100,100];endVal = [0,0,0];
if (t < duration){
linear(t,0,duration,startVal,endVal);
}else{
amp = (endVal - startVal)/duration;
w = freq*Math.PI*2;
endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);}
Copy link to clipboard
Copied
Here's a link to my video tutorial course on learning expressions for After Effects. I recommend that you do this course to learn how to use expressions before tackling this 🙂
Copy link to clipboard
Copied
Would it be possible for you to explain briefly here? I just want to know the algorithm of this expression, don't need to be really detailed. Thanks!
Copy link to clipboard
Copied
It's a simple sine wave modulated through an additional exponential falloff. Aside from that there seems little point in explaining expressions if you have zero knowledge about basics of JavaScript. That's like talking to a blind man about the sun.
Mylenium
Copy link to clipboard
Copied
Hi I want the Persian text to be from right to left, but this program is defined for English, please help me
freq = 1;
decay = 5;
duration = 0.1;
retard = textIndex*thisComp.frameDuration*1;
t = time - (inPoint + retard);
startVal = [100,100,100];
endVal = [0,0,0];
if (t < duration){
linear(t,0,duration,startVal,endVal);
}else{
amp = (endVal - startVal)/duration;
w = freq*Math.PI*2;
endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);
}
Copy link to clipboard
Copied