FORUMS: list search recent posts

# Shifting position when parent layer is rotating

FAQ   •   VIEW ALL
 Shifting position when parent layer is rotating on Feb 12, 2015 at 5:08:11 amLast Edited By Christoph Müller on Feb 12, 2015 at 5:19:35 am

For a puppet head turn I would like the position of eyes/nose/mouth to shift 30 pixels horizontally when the parent layer (the head) rotates 10 degrees (Y Rotation). Is this possible with an expression?

I am playing around with

p = parent.transform.yRotation;
delta = p - p.valueAtTime(0);
value - delta*-.8

but it seems only to work when I parent the position to position. No luck with position to yRotation.

Anyone knows of a straight forward expression for this?

Edit:
Actually thinking about it, it would even be nicer if it is independent of parenting. Just when a certain layer is rotating then the layer with the expression applied should move in yPosition.

 Re: Shifting position when parent layer is rotatingon Feb 12, 2015 at 11:39:20 am

[Christoph Müller] "Actually thinking about it, it would even be nicer if it is independent of parenting. Just when a certain layer is rotating then the layer with the expression applied should move in yPosition."

For independence of parenting, you want to get the world coordinates of a layer. Check out this thread for some advice:

Walter Soyka
Motion Graphics, Widescreen Events, Presentation Design, and Consulting

 Re: Shifting position when parent layer is rotatingon Feb 13, 2015 at 4:47:56 am

Thanks Walter for your response, but I have no clue what that is and what it could have to do with what I want to do. Sorry, I am new to this.

At the end I think when I parent an expression to another layer, then I am still parenting (?)... probably yes. So actually I don't have to make it even more complicated with world coordinates. Hopefully not.

Isn't there something like:

then comp("Puppet").layer("Face_CTRL").effect("yPosition")30

obviously it must be more complex than that so it works both ways, left and right + for the smaller values it would have to calculate somehow a percentage... but as said, no idea how to achieve that. :(

 Re: Shifting position when parent layer is rotatingon Feb 13, 2015 at 5:09:51 am

Nevermind. It seems to work with:

[-temp*3, 0]

This moves the layer 3 times the value of the yRotation. Works perfectly. Is this the best method to achieve this?

 Re: Shifting position when parent layer is rotatingon Feb 13, 2015 at 5:36:02 am

[Christoph Müller] "This moves the layer 3 times the value of the yRotation. Works perfectly. Is this the best method to achieve this?"

This works as long as the referenced layer is not parented to something that is also rotating. To capture the rotation of the layers parent(s) as well, you'd need to use the expression Dan shared in the thread I linked above.

Walter Soyka
Motion Graphics, Widescreen Events, Presentation Design, and Consulting

 Re: Shifting position when parent layer is rotatingon Feb 14, 2015 at 12:11:49 am

ok. Thanks for clarifying, but how would I do that?

L = thisComp.layer("Null 1");
L.toWorld(L.anchorPoint)

+