Copy link to clipboard
Copied
I guess I'm missing something regarding the PointOnPath property.
When placing a Solid on the position of a Path Point, it takes te right lower corner in stead of the Anchor Point for the position (see screenshot).
How can I get it to work with the actual Anchor Point?
This is my expression in the position property of the Solid:
p = thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path.pointOnPath(0);
toComp(p);
Try it this way:
L = thisComp.layer("Shape Layer 1");
p = L.content("Shape 1").content("Path 1").path;
L.toComp(p.pointOnPath(0))
Copy link to clipboard
Copied
You need to account for the difference in coordinate origin - center vs. top left corner - and subtract half the width and height.
Mylenium
Copy link to clipboard
Copied
Thank you Mylenium, that is a logical thing to do, but it feels a bit like a workaround. I don't understand why the anchor point is ignored and, of all points, the right lowerhand corner is taken (while in other Ae-situations, the coordinates are taken from the center or left upper corner).
Do you have an explanation for that behaviour just for me to understand the logic?
Copy link to clipboard
Copied
Try it this way:
L = thisComp.layer("Shape Layer 1");
p = L.content("Shape 1").content("Path 1").path;
L.toComp(p.pointOnPath(0))
Copy link to clipboard
Copied
Thank you Dan! That did it!
(Is it because the Solid was in Layer Space?)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now