FORUMS: list search recent posts

How to get shape path vertices with script?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
joshua faget
How to get shape path vertices with script?
on Oct 16, 2016 at 1:03:26 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);


Return to posts index

Xavier Gomez
Re: How to get shape path vertices with script?
on Oct 16, 2016 at 3:54:01 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


Return to posts index

joshua faget
Re: How to get shape path vertices with script?
on Oct 16, 2016 at 5:11:34 pm

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

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

alert(selectedShape);


Return to posts index


Xavier Gomez
Re: How to get shape path vertices with script?
on Oct 16, 2016 at 6:00:54 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.


Return to posts index

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