-
How do I put all paths from shape layer in an array?
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.pngThis 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
Sorry, there were no replies found.