Skip to main content
February 26, 2013
Question

Track nested child layer's position

  • February 26, 2013
  • 1 reply
  • 7074 views

Hi,

I have a Main Comp with a layer named 'Controller'.I have several 2d layers parented to this controller.

Now,i need to precompose two of them.let's say this precomposition of these two layers is named 'precomp 1'.

How can i parent these two layers in the 'precomp1' to the 'Controller' in the Main Comp again via Expression?

Dan,any ideas?

This topic has been closed for replies.

1 reply

françois leroy
Inspiring
February 26, 2013

Hi!

The easy way is to have a copy of your 'Controller' in 'precomp 1'.

Your 2 layers will be parented to it.

On 'Controller' s position, put the following expression:

comp("Main Comp").layer("Controller").position;

The same for Scale, Rotation, AnchorPoint, if needed.

François

February 26, 2013

hi there,

You are right,that'll work but i'm wondering if there is a more elegant version without duplicating the controller layer.

I'd like to have the precomposed layers kind of parented to the layer “Controller” without being in the same comp.It's all in 2d space

françois leroy
Inspiring
February 27, 2013

Hello,

Yes, ahhh the anchor points are different.

Controller layer is a null 100x100Px Anchor Point = 0,0

Layers in the precomp are 1280x720 Anchor Point= 640,360

The offset is [640,360] or ?


Can you give me more precisions?

Did you take the option to duplicate the 'Controller'? With your layers attached?

Or do you try to get the absolute position of the layers directly?

Or did you apply the corner pin effect?

Don't be scared to give too much infos... Details can change everything.