Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I know or use element attributes in pre-compositing, such as position, rotation, etc.?

New Here ,
Nov 25, 2025 Nov 25, 2025

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)

TOPICS
Dynamic link , Error or problem , Expressions , How to , Scripting
138
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 24, 2025 Dec 24, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 28, 2025 Dec 28, 2025
LATEST

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).  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines