• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Layer parenting with JSFL

Explorer ,
Oct 14, 2022 Oct 14, 2022

Copy link to clipboard

Copied

Is there a way to use JSFL to access layer parenting info? 

Views

406

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2022 Oct 15, 2022

Copy link to clipboard

Copied

yes, layers have a parentLayer property.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 15, 2022 Oct 15, 2022

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 ? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2022 Oct 15, 2022

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 15, 2022 Oct 15, 2022

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? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2022 Oct 15, 2022

Copy link to clipboard

Copied

LATEST

i doubt it.  at least, i don't believe jsfl capabilities have been updated to deal with rigging.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines