Activity › Forums › Adobe After Effects Expressions › Possible expression to move Z axis on one layer when Y axis moves on another layer?
-
Possible expression to move Z axis on one layer when Y axis moves on another layer?
Posted by Matthew Ruiz on August 13, 2015 at 12:18 amHopefully this question makes sense I feel confident this possible but I am unsure on how to do so.
In a 3D project when the Y axis moves I want the Z axis on another layer to move coherent with the Y axis.
Hope that makes sense,
Matt
Matthew Ruiz replied 11 years ago 2 Members · 6 Replies -
6 Replies
-
Dan Ebberts
August 13, 2015 at 1:52 amThere are a couple of ways to interpret what you’re asking for. The most common requires a reference–either a hard-coded value for y, or, as in this example, where the layer was at time zero.
p = thisComp.layer(“other layer”).transform.position;
y = p.value[1] – p.valueAtTime(0)[1];
value + [0,0,y]Note that nothing will happen until you animate the y-motion layer, then the layer with the expression should match the movement in z.
Dan
-
Matthew Ruiz
August 13, 2015 at 3:42 amI think I am doing something wrong but not sure where the layer “front control” is my Y axis layer I am putting the expression on the Z axis layer “bottom control” I plug in the expression below in the Z axis layer but the “bottom control” (aka Z axis layer) does not move with it am I missing a bit of information into the expression?
Thanks,
Matt
p = thisComp.layer("Front controls").transform.position
y = thisComp.layer("Front controls").transform.position[1] - p.valueAtTime(0)[1];
value + [0,0,y]
-
Dan Ebberts
August 13, 2015 at 3:47 amYou have to animate “front control” (with keyframes or an expression), or nothing will happen.
Dan
-
Matthew Ruiz
August 13, 2015 at 4:40 amI’m sorry I completely asked the wrong question, (long day) your expression worked flawlessly thank you. I meant to ask if I wanted to do the same exact effect except I want the Z axis to go opposite direction how would I do that in the expressions if possible?
Thanks,
Matt
Reply to this Discussion! Login or Sign Up