ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Anchor point of a shape layer atttached to vertex of path

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sergio Pol
Anchor point of a shape layer atttached to vertex of path
on Jun 19, 2020 at 6:30:12 pm

Hello, I'm trying to create a text label that follows an element in video footage by tracking. The text is linked to a path that points to the element. I find myself changing the shape of that path to better suit the video when I create copies of the label for other elements. This means I have to manually change the anchor point of the shape layer every time I change the path since the animation of it it's supposed to come from the origin of the path.
I found a tutorial to link a null to a vertex of a path of a shape layer and tried to apply it directly to the anchor point but it didn't work, I then tried to apply it to a null that would control the path but it also didn't work. The ideal is I can apply the code to the anchor point so I don't have to deal with another layer. Can you please help me find where I'm failing?




Thank you.

p = thisComp.layer("line").content("Shape 1").content("Path 1").path;
l = thisComp.layer("line");
l.toComp(p.points()[0])


Return to posts index

Filip Vandueren
Re: Anchor point of a shape layer atttached to vertex of path
on Jun 21, 2020 at 10:03:17 am

Since you are working from within the layer, there is no need for the toComp() method.

this works for me as an expression for anchorpoint.

Caveat: if any of the Shape's transform properties are not set to default,
then it will be off, and I don't see an easy way of fixing that with an expression.
I mean the shape's transform, not the layer's (see screenshot)


p=content("Shape 1").content("Path 1").path;
p.points()[0];




Return to posts index

Sergio Pol
Re: Anchor point of a shape layer atttached to vertex of path
on Jun 22, 2020 at 9:54:45 pm

Thanks a lot Filip. I ended up using the script "Create nulls from paths extended" that adds a lot of funcionalities to the basic version that comes with AE. Your info is still useful and I apprectiate you take your time to anwser my question.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]