Activity › Forums › Adobe After Effects Expressions › Scale affected by speed.
-
Scale affected by speed.
Posted by Joan Valdes on June 17, 2009 at 2:48 pmHi!
Is there a way to read the speed value of an animated layer and let it affect the scale an a second layer? So the faster the Layer A goes, the bigger Layer B gets.
Thanks!
/JoanJoan Valdes replied 16 years, 11 months ago 3 Members · 7 Replies -
7 Replies
-
Darren Hardaway
June 17, 2009 at 4:28 pmAssuming the speed of the object is controlled by it’s position or anchorpoint transformation use the pickwhip to call this value to the other layers scale property. The pickwhip is the little swirly button that appears when you open the expression editor of a property. Click and drag it to the position or anchorpoint value of the “speed” layer and then turn it into a variable, then call the way you want the speed to affect the scale. For example, if the object were to go from the left to right side of the comp you could make the scale of the object increase and decrease from 0 to 100 in a loop like this:
x = thisComp.layer(“speed”).transform.position;
Math.abs(Math.sin(x)*100) -
Dan Ebberts
June 17, 2009 at 4:35 pmYou could do it like this:
scaleFactor = 100;
s = thisComp.layer(“Layer A”).transform.position.speed;
value*(s/scaleFactor)You would increase the scaleFactor to reduce the effect.
Dan
-
Darren Hardaway
June 17, 2009 at 4:39 pmHey, whats that little bit there at the end?
.speed
how does that work?
-
Dan Ebberts
June 17, 2009 at 4:44 pmThe position property has speed and velocity attributes. speed is just the magnitude, velocity is a vector that indicates the current direction as well as the magnitude.
Dan
-
Darren Hardaway
June 17, 2009 at 5:01 pmOkay, so it goes by the factor of After Effect’s time, uses pixels as units of measurement?
-
Joan Valdes
June 17, 2009 at 7:12 pmHey!
Thanks guys! That .speed value was exactly what I was looking for. Worked perfectly!
Reply to this Discussion! Login or Sign Up