Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create Shape Layer with a script – how to control properties?

  • Create Shape Layer with a script – how to control properties?

    Posted by Benjamin Leng on October 18, 2014 at 11:35 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();

    Dan Ebberts replied 11 years, 1 month ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    October 19, 2014 at 3:08 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:

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

    Dan

  • Benjamin Leng

    October 19, 2014 at 10:09 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

  • Ernestas Cepulionis

    April 14, 2015 at 1:36 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");
    ....

  • Dan Ebberts

    April 14, 2015 at 5:37 pm

    Try changing “ADBE Vector Graphic – Repeater” to “ADBE Vector Filter – Repeater”.

    Dan

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