Copy link to clipboard
Copied
Hi all
BIt of a novice on expressions
I have a lot of text I need to animate, what i'd like is an expression which uses the inPoint and endPoint of the layer to play the text Animator and animate the words in and out.
Mainly so that I dont have to adjust the distance between keyframes depending how many words are in that text layer, meaning the speed of the animations are consistent/standardised.
e.g A text layer with 1 word will take 0.1 seconds to transition, 5 words will take 0.5 seconds, and a layer with 10 words take 1 second.
I'm currently using this bounce expression on an Expression Selector in the Animator-
delay = .00;
myDelay = delay*textIndex;
t = (time - inPoint) - myDelay;
if (t >= 0)
{
freq =0.0;
amplitude = 250;
decay = 10;
s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
[s,s]
}
else
{
value
}
this basically does what I'm after (though has unnecessary bounce code in there as dont know how to remove), but I'm struggling to work out how to do this for the transition out.
Thanks for any help!
Copy link to clipboard
Copied
My brain is a bit fried at the moment, but something liek this should work (untested):
mSpeed=0.1;
mDur=mSpeed*textTotal;
mStart=time-inPoint;
mEnd=outPoint-time;
if (time => inPoint && time <= inPoint+mDur)
{mStart*mSpeed*textIndex};
else if (time <= outPoint && time >= outPoint-mDur)
{mEnd*mSpeed*(textTotal-textIndex)};
else
{value};
Mylenium
Copy link to clipboard
Copied
Thanks, this gives me an error-
Copy link to clipboard
Copied
I think if you make sure you delete the Range Selector and set the Scale Animator value to 0, then you should be able to use an Amount expression like this for the Expression Selector:
fadeDur = .7;
fadeIn = linear(time,inPoint,inPoint+fadeDur,100,0);
fadeOut = linear(time,outPoint-fadeDur,outPoint,0,100);
Math.max(fadeIn,fadeOut)
Copy link to clipboard
Copied
Thanks, It's position/opacity i'm trying to animate (so the words move down and fade)
On position, it almost does the job but it moves the entire line (the animator is set to wrods) and doesnt stagger them.
On scale, it scales the individual word but also with no stagger/delay.
Appreciate the help!
Copy link to clipboard
Copied
Ah, OK. I saw you had the delay set to .00 so I figured you weren't using it. Try it this way:
fadeDur = .7;
delay = .1;
t = time - (textIndex-1)*delay
fadeIn = linear(t,inPoint,inPoint+fadeDur,100,0);
fadeOut = linear(t,outPoint-fadeDur-textTotal*delay,outPoint-fadeDur,0,100);
Math.max(fadeIn,fadeOut)
Copy link to clipboard
Copied
Thanks this is perfect!