FORUMS: list search recent posts

Create Shape Layer with a script - how to control properties?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Benjamin Leng
Create Shape Layer with a script - how to control properties?
on Oct 18, 2014 at 11:35:04 pm

Hi There,

here is what I am trying to do: I want to create shape layers in the form of a hexagon (polystar path, type polygon with 6 points).

After a lot of searching I found a method to create an ellipse shape layer (addProperty("ADBE Vector Shape - Ellipse")) and by trial and error found out, that "addProperty("ADBE Vector Shape - Star")" gives me a Polystar shape. But trying to change the "Type"-Property I come up empty handed.

Is there a resource where one can look up the correct property-names? How do you find out that for example "ADBE Vector Shape - Star" is the correct parameter to get a polystar? I had to literally GUESS to get that. There must be some kind of reference manual. In the CS6 Scripting Guide I find nothing.

Can somebody help me out here?

Thanks in advance

app.beginUndoGroup("Add new shape layer");

var curComp = app.project.activeItem;

if(curComp){ var shapeLayer = curComp.layers.addShape();
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Star");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
}

app.endUndoGroup();


Return to posts index


Dan Ebberts
Re: Create Shape Layer with a script - how to control properties?
on Oct 19, 2014 at 3:08:53 am

As far as I know, there's no official reference. I use an indispensable script from Jeff Almasol (rd_GimmePropPath) to discover obscure property paths.

You can get it at Jeff's site:

http://www.redefinery.com/ae/rd_scripts/


Dan



Return to posts index

Benjamin Leng
Re: Create Shape Layer with a script - how to control properties?
on Oct 19, 2014 at 10:09:22 am

Mr. Ebbert, Thank you so very much, this script is veeeery helpful. The Property I was looking for apparently was "ADBE Vector Star Type". I got it working now :)

I just realized that basically EVERY useful info about AE-Scripting Google can find comes from Dan Ebberts personally. So, thank you for your incredible help all around - it seems YOU are the personified AE-Script-Reference!

Benjamin Leng

app.beginUndoGroup("Add new shape layer");

var curComp = app.project.activeItem;

if(curComp){ var shapeLayer = curComp.layers.addShape();
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
var myStar = shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Star");
myStar.property("ADBE Vector Star Type").setValue(2);
myStar.property("ADBE Vector Star Points").setValue(6);
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
}

app.endUndoGroup();

//app.project.item(index).layers.addShape


Return to posts index


Ernestas Cepulionis
Re: Create Shape Layer with a script - how to control properties?
on Apr 14, 2015 at 1:36:15 pm

Hello,

I wonder, it is possible to add a REPEATER to my shape layer using the script? I got an error when i'm trying to add a repeater to my script:
//
var myRepeater = shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Repeater");
//
AE error: asked to create unknown property of type "ADBE Vector Graphic - Repeater" (1d16).

Is there any list of all ADBE Vector properties?

var myShapeLayer = myComp.layers.addShape();
myShapeLayer.name = ("Ball");
var shapeGroup = myShapeLayer.property("Contents").addProperty("ADBE Vector Group");
var myEllipse = shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Ellipse");
myEllipse.property("Size").setValue([200,100]);
var myStroke = shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
myStroke.property("Color").setValue([255,255,0]);
myStroke.property("Opacity").setValue([100]);
myStroke.property("Stroke Width").setValue([2]);
var myFill = shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
myFill.property("Color").setValue([0,0,255]);
myFill.property("Opacity").setValue([100]);
var myRepeater = shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Repeater");
....


Return to posts index

Dan Ebberts
Re: Create Shape Layer with a script - how to control properties?
on Apr 14, 2015 at 5:37:21 pm

Try changing "ADBE Vector Graphic - Repeater" to "ADBE Vector Filter - Repeater".

Dan



Return to posts index

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