Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Anchor point of a shape layer atttached to vertex of path

  • Anchor point of a shape layer atttached to vertex of path

    Posted by Sergio Pol on June 19, 2020 at 6:30 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])

    Sergio Pol replied 5 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    June 21, 2020 at 10:03 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];

  • Sergio Pol

    June 22, 2020 at 9:54 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.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy