Forums › Adobe After Effects Expressions › Using linear expression twice in one layer
Tagged: Basic
Using linear expression twice in one layer
Danyl Bernard
December 22, 2020 at 9:43 pmHi all,
I have two linear expressions like this
compLength = thisComp.duration;
linear(time, inPoint, 1.2, [-1035.6667], [-2655.907]);linear(time, compLength + .2, compLength - 1, -2655.907, -7500);
The first one changes the z parameter for the beginning of the comp, and the second one changes the end. But for some reason, only the second expression works.
If I split them into two different layers and cut the layer midpoint in the comp, they both work fine. However, using them in the same comp doesn’t work.
Also, how do I use a parameter like scale that has more than 1 parameter while using linear()
Thank you
Dan Ebberts
December 23, 2020 at 1:09 amTry it this way:
compLength = thisComp.duration;
if (time <= 1.2)
linear(time, inPoint, 1.2, -1035.6667, -2655.907)
else
linear(time, compLength - 1, compLength + .2, -2655.907, -7500);
Danyl Bernard
April 8, 2021 at 4:25 amHi,
It’s been a while, but this worked great.
Thank you
Log in to reply.