-
Adding function to an expression
Hi!
So, i’ve been using the following expression (pasting a “short version” of it) to add automatic behaviors to the start/end of a layer, at properties such as opacity.
Now, I had this idea of applying the same expression to the “end” property of a trim path animation. And it does work. Except that… For some properties (e.g. position), I like to shape my speed like this:

And the built in “ease out” function produces nothing of the sort. So, researching over the internet I came across this magnificent site:
http://gizma.com/easing/#expo3
And, in it, I found the following function to be added to my expression:
Math.easeInOutExpo = function (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2 * Math.pow( 2, 10 * (t – 1) ) + b;
t–;
return c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b;
};The question is: how can I integrate this function to my already working expression?
dur = Math.round(effect("Slider Control")("Slider"));StartIn = inPoint;
StartOut = inPoint + dur;EndIn = outPoint - dur;
EndOut = outPoint;if (time>=StartIn && time <= StartOut)
ease(time,StartIn,StartOut,0,100);
else if (time>=EndIn && time <= EndOut)
ease(time,EndIn,EndOut,100,0);
else
value;