Activity › Forums › Adobe After Effects Expressions › What does “Linear()” do?
-
What does “Linear()” do?
Posted by Erin Shelby on November 10, 2005 at 11:59 pmI saw this in an expression example and I’m wondering what it does
Colin Braley replied 19 years, 5 months ago 2 Members · 1 Reply -
1 Reply
-
Colin Braley
November 11, 2005 at 3:38 amlinear() is an interpolation method. (By the way, I don’t have AE in front of me so I can’t currently check on/test any of this.) linear() usually takes 5 arguments (things in parentheses). These are: linear(t, tMin, tMax, value1, value2). What it does is it looks at the value t and as t varies from tMin to tMax it makes value change from value1 to value2. That sounds kindof confusing but with an example it isn’t too hard to figure out. For instance:
//this would be an expression for opacity
linear(time, 0, 2, 0, 100)
this expression would make opacity go from 0 to 100 as time went fron 0 to 2. Usually linear() will be used with time but sometimes you can use it for other things such as in the following example:
//This would be an expression for scale
pos = thisComp.layer(“random layer”).position;
linear(pos[0], 10, 200, 50, 150)
this expression would make the scale of the layer vary from 50 to 150 as the x coordinate of random layer’s position varied from 10 to 200. There are other interpolation methods such as ease(), easeIn(), and easeOut(). Check the manual on these for once you understand linear() these are pretty self-explanatory.
~Colin
Reply to this Discussion! Login or Sign Up