Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to get shape path vertices with script?

  • How to get shape path vertices with script?

    Posted by Joshua Faget on October 16, 2016 at 1:03 pm

    Hello,

    What I am trying to do is get all the vertices points from a selected path. Is this possible?

    I tried doing as described on page 177 of CS6 scripting guide, but I am getting a undefined result.

    var selectedShape = app.project.activeItem.selectedProperties[0].value.vertices ;

    alert(selectedShape);

    Xavier Gomez replied 9 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Xavier Gomez

    October 16, 2016 at 3:54 pm

    What property are you selecting ? Normally your code line should work if you select a mask path property or a shape path property.

    It won’t work for special shapes like Ellipse/Rectangle/Star (you’d need to convert them to a path before).

    Xavier

  • Joshua Faget

    October 16, 2016 at 5:11 pm

    I was selecting the proper thing, adding a .path fixed it!

    var selectedShape = app.project.activeItem.selectedProperties[0].path.value.vertices;

    alert(selectedShape);

  • Xavier Gomez

    October 16, 2016 at 6:00 pm

    Ah ok…

    if you select a mask path (keyframable), the mask group (renamable) is selected along, and selectedProperties[0] is the mask group, not the mask path.

    Same for paths inside vector layers.

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