-
Using an Expression Selector to animate position by Layer Marker with eases
So i’m trying to animate some text on screen using text markers since I need to time it to some audio. I have some code that I found from here long ago (a Dan Ebbert’s original if I recall correctly) that achieves a similar effect to what I’m going for, but it’s for bouncing text instead of eased look. Can’t seem to reverse engineer it, despite my best efforts. Ideally I’d be able to control the rate of easing as well, but I don’t think we’re able to do that with expressions yet are we?
Would anyone be able to crack this? Included below is the code.
freq = 3;
decay = 5;
startVal = [100,100];
endVal = [0,0];
dur = 0.1;
try{
t = time – marker.key(textIndex).time;
}catch (err){
t = 0;
}
if (t > 5){
endVal
}else if (t > 0){
if (t < dur){
linear(t,0,dur,startVal,endVal);
}else{
amp = (endVal – startVal)/dur;
w = freq*Math.PI*2;
endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);
}
}else
startVal
Sorry, there were no replies found.