Activity › Forums › Adobe After Effects Expressions › Determining Parent Layer Control
-
Determining Parent Layer Control
Posted by Y. Bar on January 16, 2010 at 4:38 pmHello,
I have a Camera Layer which is parented to a Null layer which contains rotation and position keys. Is there a way that I could make the Null layer affect the Camera layer, in the same timing, but a little less magnitude ? (for example to move half the way the null layer moves)
Thanks, Y.
Will Skinner replied 16 years, 3 months ago 3 Members · 9 Replies -
9 Replies
-
Dan Ebberts
January 16, 2010 at 6:35 pmHere’s an example for position. First you need to specify a point of reference (in this case I used the parent layer’s positon at time zero).
ref = parent.transform.position.valueAtTime(0);
delta = parent.transform.position – ref;
factor = .333; // move one third as far as parent (max value = 1.0)value – delta*(1-factor)
Dan
-
Y. Bar
January 16, 2010 at 7:25 pmI guess I should remove the parenting from the camera first if I want the expression to work?
Cause with the parenting on it stays as before.
How should I reference the ‘motion’ layer once I remove the parenting ?Thanks, Y.
-
Dan Ebberts
January 16, 2010 at 8:30 pmNo, the expression assumes the layer has a parent. You need to create keyframes moving the parent around before the expression has any effect.
Dan
-
Y. Bar
January 16, 2010 at 9:55 pmThe parent layer indeed has keys in it, and so the camera layer moves, but always in the same motion as the parent layer, even though I entered that expression and modified the factor value to values between 1 and 0.001 – the motion is always constant..
-
Dan Ebberts
January 16, 2010 at 11:46 pmI don’t have a clue. It works for me.
You have the camera parented directly to the null, the null moves via position keyframes, and the camera motion is unaffected by expression, is that correct?
Dan
-
Y. Bar
January 17, 2010 at 7:04 amThat’s correct, I have the camera parented to the Null, and it moves according to the Null layer’s movement, regardless of the value I put in ‘factor’.
-
Will Skinner
April 11, 2010 at 9:50 amHi Dan
I have used this expression successfully for the position, but i can’t get it to work for Rotation. Was it intended for Rotation aswell or does that require a different expression ?
Thanks!
Reply to this Discussion! Login or Sign Up