Skip to main content
Participant
May 16, 2021
Answered

Pick Whip issue

  • May 16, 2021
  • 2 replies
  • 2417 views
This is a simple question, need to know if it's a known AE limitation or if it's a bug related to Mac.
 
If a layer is parented to another layer, a third layer can’t pick whip to its position, it doesn't work.
 
Thanks
This topic has been closed for replies.
Correct answer Rick Gerard

It's not a bug. Simply pointing another layer to a child layer's position never works because the child layer's position after perenting is always relative to comp center and the distance to the parent. 

 

Three layers, all at comp center:

Parent the Child layer and the Child layer position changes to 0,0 or 0, 0, 0 for a 3D layer. Pickwhip moves the Problem layer to the same comp coordinates as the child layer, but that is not what you want:

Thinking that just subtracting the comp center seems like it might work:

But this fails if you move the child layer:

The solution is Layer Space Transformations. They will lock the problem layer to the child layer.

If you want to be able to move the problem layer and still have it follow the child layer you need to compensate for the comp center offset by subtracting the comp center from the current position value and then add the corrected child position:

Here's the fix all expression that works if the child layer is named "Child":

L = thisComp.layer("Child");
ChildPosition = L.toWorld([0, 0, 0]); // solves problem with 3D layers
// Position Fix
CmpCenter = [thisComp.width, thisComp.height]/2;
value - CmpCenter + ChildPosition

 I have a version of this expression saved as an animation preset. I use it to create virtual child layers that do not respond to position, rotation or scale of a parent layer.

2 replies

Rick GerardCommunity ExpertCorrect answer
Community Expert
May 16, 2021

It's not a bug. Simply pointing another layer to a child layer's position never works because the child layer's position after perenting is always relative to comp center and the distance to the parent. 

 

Three layers, all at comp center:

Parent the Child layer and the Child layer position changes to 0,0 or 0, 0, 0 for a 3D layer. Pickwhip moves the Problem layer to the same comp coordinates as the child layer, but that is not what you want:

Thinking that just subtracting the comp center seems like it might work:

But this fails if you move the child layer:

The solution is Layer Space Transformations. They will lock the problem layer to the child layer.

If you want to be able to move the problem layer and still have it follow the child layer you need to compensate for the comp center offset by subtracting the comp center from the current position value and then add the corrected child position:

Here's the fix all expression that works if the child layer is named "Child":

L = thisComp.layer("Child");
ChildPosition = L.toWorld([0, 0, 0]); // solves problem with 3D layers
// Position Fix
CmpCenter = [thisComp.width, thisComp.height]/2;
value - CmpCenter + ChildPosition

 I have a version of this expression saved as an animation preset. I use it to create virtual child layers that do not respond to position, rotation or scale of a parent layer.

Participant
May 16, 2021

Thanks Rick.  This expression works really well.

Participant
August 25, 2022

If you link to the position of a child layer, the link won't pick up the inherited movement. But you can track the anchor point of the child in comp space by using this expression in the position property:

target = thisComp.layer("child") //select green text and pickwhip to your chosen layer

target.toComp(target.anchorPoint);

Mylenium
Legend
May 16, 2021

I believe it's a bug with this new-fangled transform/ 3D gizmo stuff. I vaguely recall a similar post.

 

Mylenium

Participant
May 16, 2021

Thanks Mylenium.  Do you know of a workaround?  I think there's an expression that sort of works but not really.

T