FORUMS: list search recent posts

About Shape expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Diego Mellado
About Shape expression
on Jan 24, 2012 at 9:03:24 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


Return to posts index

Dan Ebberts
Re: About Shape expression
on Jan 24, 2012 at 9:22:43 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



Return to posts index

Diego Mellado
Re: About Shape expression
on Jan 24, 2012 at 10:46:57 pm

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


Return to posts index



Dan Ebberts
Re: About Shape expression
on Jan 24, 2012 at 11:50:05 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



Return to posts index

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