Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do you add a shape (ellipse, rectangle etc) to a shape layer via script.

  • How do you add a shape (ellipse, rectangle etc) to a shape layer via script.

    Posted by Jamie Bradshaw on January 24, 2013 at 9:31 pm

    Hi.

    I’m new to scripts (although not expressions) and I’m struggling with some simple bits…

    If I have created a shape layer by using:
    var myShapeLayer = app.project.activeItem.layers.addShape();

    How do I then add things such as Groups and Shapes to the layer?

    Thanks,
    Jamie

    JimJam•Graphics
    https://www.jimjamgraphics.com/

    Dan Ebberts
    replied 13 years, 3 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 24, 2013 at 10:34 pm

    The syntax is a little tricky, but as an example, here’s how you would add an ellipse to your shape layer:

    var myShapeLayerContents = myShapeLayer.property(“ADBE Root Vectors Group”);
    var myShapeGroup = myShapeLayerContents.addProperty(“ADBE Vector Group”);
    var myEllipse = myShapeGroup.property(“ADBE Vectors Group”).addProperty(“ADBE Vector Shape – Ellipse”);

    Dan

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