Copy link to clipboard
Copied
Is there a way to use JSFL to access layer parenting info?
Copy link to clipboard
Copied
yes, layers have a parentLayer property.
Copy link to clipboard
Copied
Thanks Kglad. There's nothing about this property online. I'm not in front of An to try it but is it possible to read and set a layer's parent with something like: layer.parentLayer = 3 ?
Copy link to clipboard
Copied
no.
Usage
layer.parentLayer
Description
Property;
a Layer object that represents the layer’s containing folder, guiding, or masking layer. The parent layer must be a folder, guide, or mask layer that precedes the layer, or the parentLayer of the preceding or following layer. Setting the layer’s parentLayer does not move the layer’s position in the list; trying to set a layer’s parentLayer to a layer that would require moving it has no effect. Uses null for a top-level layer.
Example
The following example uses two layers at the same level on the same timeline. The first layer (layers[0]) is converted into a folder and then set as the parent folder of the second layer (layers[1]). This action moves the second layer inside the first layer.
var parLayer = fl.getDocumentDOM().getTimeline().layers[0];
parLayer.layerType = "folder";
fl.getDocumentDOM().getTimeline().layers[1].parentLayer = parLayer;
Copy link to clipboard
Copied
Ok thanks. The kind of layer parenting property I was hoping to access is how layers can now be parented to other layers for use in a character rig. Is that possible?
Copy link to clipboard
Copied
i doubt it. at least, i don't believe jsfl capabilities have been updated to deal with rigging.