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

Expressions that work with layers in other Comps

New Here ,
Feb 19, 2023 Feb 19, 2023

KakaoTalk_20230220_023416320.png

 

제목 없음.png

 

I need an expression that allows the "shape" layer to be placed in the center left of the "Shape layer 1".

 

What's wrong with my code?

rect = comp("Pre-comp 1").layer("Shape Layer 1").sourceRectAtTime();
[rect.left, rect.top + rect.height/2]

 

TOPICS
Expressions , FAQ
274
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

correct answers 1 Correct answer

Community Expert , Feb 19, 2023 Feb 19, 2023

Try it this way:

L1 = comp("Pre-comp 1").layer("Shape Layer 1");
rect = L1.sourceRectAtTime();
p = L1.toComp([rect.left, rect.top + rect.height/2]);
L2 = thisComp.layer("Pre-comp 1");
L2.toComp(p)
Translate
Community Expert ,
Feb 19, 2023 Feb 19, 2023
LATEST

Try it this way:

L1 = comp("Pre-comp 1").layer("Shape Layer 1");
rect = L1.sourceRectAtTime();
p = L1.toComp([rect.left, rect.top + rect.height/2]);
L2 = thisComp.layer("Pre-comp 1");
L2.toComp(p)
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