Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do I put all paths from shape layer in an array?

  • How do I put all paths from shape layer in an array?

    Posted by Sander Van dijk on March 24, 2014 at 11:27 pm

    Hi,

    I want to find all the Paths of my parented shape layer and store them into an array.

    How can I run a loop checking all the children in “contents” so that it will work when paths are in shapes or groups inside groups?
    This is the Array I want to create: https://dl.dropboxusercontent.com/u/8528087/ScreenshotPaths.png

    This is what I have so far Applied to the path of my shape layer that has another shape layer with paths I want to clone as parent.

    var myParent = thisLayer.parent;
    var numRootContents = myParent.content(1).propertyGroup(1).numProperties;
    var mySelection = 1 % numRootContents; //slider to choose a path from the parented shape layer.

    var myPaths = [];
    var numPath = 0;
    var root = "myParent"
    var addContent = ".content("

    for (var i=1; i<= numRootContents; i++){
    if ( myParent.content(i)(2).name == "Path" ){
    myPaths[numPath] = root + addContent + i +")";
    numPath++
    };
    }

    var mySelection = 1 % numPath;
    eval( myPaths[ mySelection ] )(2);

    Thanks,
    Sander

    Sander Van dijk replied 12 years, 1 month ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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