Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions About Shape expression

  • About Shape expression

    Posted by Diego Mellado on January 24, 2012 at 9:03 pm

    Dear all,
    Thanks a lot for your help and support.
    I am looking for some help about expressions regarding .shape.
    I have a defined a shape layer. Then I have drawed a line, defined by, let’s say, 3 points. Then, inside “Contents” I have a “Shape 1” element with all its chars: Path, Stroke etc…
    I would like to know what expresions are available for that path (content(“Shape 1”).content(“Path 1”).path…) For example, is there any way to refer to any of the three points that define the shape? I have tried .path[0] but it is not a proper sentence.

    Thanks a lot for your interest!
    Best,
    Diego Mellado

    Dan Ebberts
    replied 14 years, 3 months ago
    2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 24, 2012 at 9:22 pm

    No, path control points are not accessible. You can link a path to another path and use valueAtTime(), but that’s about it.

    Dan

  • Diego Mellado

    January 24, 2012 at 10:46 pm

    Thanks Dan!
    It seems there is a way to do it through scripts. Any hint?
    Best,
    Diego

  • Dan Ebberts

    January 24, 2012 at 11:50 pm

    You can access individual mask vertices using scripting. For example, you could retrieve the x coordinate of vertex 0 like this:

    var myPath = app.project.item(1).layer(“Shape Layer 1”).property(“Contents”).property(“Shape 1”).property(“Contents”).property(“Path 1”).property(“Path”);
    var myPathVal = myPath.value;
    var myVertex = myPathVal.vertices[0];
    var myX = myVertex[0];

    You can manipulate them by creating a local Shape object and then using setValue() to modify the vertices. It’s hard to explain fully, but it’s in the Scripting Guide.

    Dan

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