ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Child's position relative to comp, instead of parent

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Saara Salminen
Child's position relative to comp, instead of parent
on Aug 8, 2018 at 12:15:48 pm

Hi!
I'm attempting to create a face rig, and I've come to a point where I'd like a controller to guide which way the face is directed within the head.
I've got one shape layer for the head (HeadLayer), which is linked to another controller(PositionController), that is used for positioning the head.
The face is on another shape layer (FaceLayer).
I've created a second controller (DirectionController), which is supposed to move the FaceLayer around inside the HeadLayer. I linked the position values of FaceLayer to the DirectionController, and divided it with a suitable number, so that when I move the DirectionController, the face moves in the same direction, but a smaller distance.
This is exactly what I wanted, but when I then linked the FaceLayer to HeadLayer, the positon values of FaceLayer changed completely (from 400,400 to 6,-287). Which I know is only natural, because the position of the layer is now relative to the parent layer.

So my question is, how do I go around the new position values? I don't know how to calculate the movement delay with that odd numbers.

I don't know if it matters, but the position values for the HeadLayer are 0,0, and for the PositionController 400,400.

Grateful for help.


Return to posts index

Dan Ebberts
Re: Child's position relative to comp, instead of parent
on Aug 8, 2018 at 4:09:23 pm

It's hard to say exactly without seeing how you have things set up, but if you have the comp position of where you want your layer to be, you should be able to do something like this:

compPos = // your calculated position within comp
fromComp(compPos)


Dan



Return to posts index

Saara Salminen
Re: Child's position relative to comp, instead of parent
on Aug 8, 2018 at 4:31:35 pm

I'll try that out, thanks Dan!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]