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?
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]);
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
Copy link to clipboard
Copied
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]);