Track a Nested Layer: Expression Needed

Moderators: Disciple, zlovatt

Post Reply
mrblifil
Posts: 3
Joined: February 1st, 2005, 12:17 pm
Location: NYC
Contact:

We have a null linked to a parented layer in a nested comp. By using the toWorld function we are able to get the proper coordinates even though our layer is parented. However we are not able to account for the scaling and positioning of our comp in the master comp.

So to reiterate:
Layer A=parented layer

Comp B=comp containing A

Layer C=Comp B placed in Master Comp, scaled to 60%

Null D=Null placed in Master Comp, trying to get World position of Layer A

How to derive A's position in world space while taking into account the scaling of the nested comp.

As it is now, calling the toWorld function gives us coordinates that move along with the parented layer, just in the completely wrong place in the Master Comp. This is because the nested comp (Comp B) is a different size than the master comp, and is positioned and scaled.

In other words, HELP!
mrblifil
Posts: 3
Joined: February 1st, 2005, 12:17 pm
Location: NYC
Contact:

compB = comp("Comp B");
layerA = compB.layer("Layer A");
layerC = thisComp.layer("Layer C");
layerC.toWorld(layerA.toComp(layerA.anchorPoint))

Via Dan Ebberts, naturally.
Post Reply