Copy link to clipboard
Copied
I've moved and rotated several layers after pre-compositing A. Now I want to set a null at the position of an element in composite A, and then connect pre-composite A to the rest of the nulls in composite B. I can't figure out how to extract the null of an element in pre-composite A from the null in composite B. But I don't know how to extract the relative position of an element in this pre-composite A inside composite B.
Translated with DeepL.com (free version)
Copy link to clipboard
Copied
In After Effects, once you pre-compose layers into a composition, that pre-comp is treated as a single layer in the main composition, which means the position, rotation, and other transform properties of the layers inside it are no longer directly accessible from the parent comp. Because of this, you cannot directly extract or read the relative position of an element inside pre-composite A while working in composite B. To achieve what you want, you must deliberately expose or convert those internal properties. One common approach is to use expressions such as toComp() or fromComp() to convert the internal layer’s position from the pre-comp’s coordinate space into the parent comp’s space and then apply that value to a null object. Another option is to use Essential Graphics (Master Properties) to expose the position or rotation of the internal layer so it can be controlled or referenced directly in the main comp.
Copy link to clipboard
Copied
I believe it's possible to do this, if I'm understanding it correctly
** If the Shape Layer inside compA is a 3D layers, then make sure the Null layer and the compA layer inside of compB are 3D.
First, you should reset all transform properties for the Shape Layer, Null Layer, and compA to their default values (scale [100%,100%,100%], position [0,0,0], orientation[0,0,0]).
Then, in compB, put this expression on the Position of the Null layer:
var compA = thisProject.comp("Composition A");
var shape = compA.layer("Shape Layer").transform.position;
[shape[0], shape[1], shape[2]];Copy that expression to Scale, but change this line:
var shape = compA.layer("Shape Layer").transform.position;To this:
var shape = compA.layer("Shape Layer").transform.scale; Do the same for orientation and rotation XYZ if you need.
Finally, Parent the entire Null layer to the compA layer (on the Null, choose the compA layer with the dropdown menu under Parent & Link).
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more