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

Layer width as it moves on Z axis

New Here ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

I’ve made this example to simplify the original situation; The red circle has the following expression in its position:

 

a = thisComp.layer(“CIRCLE-BLUE”);

b = a.toWorld(a.transform.anchorPoint);

c = thisComp.layer(“CIRCLE-BLUE”).content(“Ellipse 1”).content(“Ellipse Path 1”).size;

[ (b[0]+c[0]/2) , b[1] ]

 

It is using the blue circle size to be parented to the right corner of the blue circle.
But the blue circle is a 3D layer, and when I move it on the Z axis, the red circle can’t calculate its new position based on the blue circle’s size referent to the comp.

Is there a way to define blue circle’s width in real time as it moves on the Z axis?

TOPICS
Expressions , How to

Views

147

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 , Mar 20, 2024 Mar 20, 2024

I think this will work for your simplified test case. You may have to robustify it for your real world project:

a = thisComp.layer("CIRCLE-BLUE");
b = a.content("Ellipse 1").content("Ellipse Path 1").size;
c = a.toComp(a.anchorPoint + [b[0]/2,0]);

 

Votes

Translate

Translate
LEGEND ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

Create a 2D point control on the large ring and feed its coordinates into the toWorld() layer space transform instead of the anchor point.

 

Mylenium

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
Community Expert ,
Mar 20, 2024 Mar 20, 2024

Copy link to clipboard

Copied

LATEST

I think this will work for your simplified test case. You may have to robustify it for your real world project:

a = thisComp.layer("CIRCLE-BLUE");
b = a.content("Ellipse 1").content("Ellipse Path 1").size;
c = a.toComp(a.anchorPoint + [b[0]/2,0]);

 

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