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

Expressions that work with layers in other Comps

New Here ,
Feb 19, 2023 Feb 19, 2023

Copy link to clipboard

Copied

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

Views

242

Translate

Translate

Report

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)

Votes

Translate

Translate
Community Expert ,
Feb 19, 2023 Feb 19, 2023

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

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