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

Create command to select the layer with a specific name.

Contributor ,
Jun 12, 2022 Jun 12, 2022

The layer selection in the history is not reflected and does not allow me to create a command to select a layer with a specific name (for example "eye"). Having this function, it would be useful to select in a character face setup.


____
2D vector animator since 2000 & PhD
213
Translate
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 ,
Jun 12, 2022 Jun 12, 2022

function selectLayerF(s){

var tl = fl.getDocumentDOM().getTimeline();
for(var i=0;i<tl.layers.length;i++){
if(tl.layers[i].name == s){
tl.setSelectedLayers(i);
break;
}
}
}

Translate
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
Contributor ,
Jun 12, 2022 Jun 12, 2022

Where would I have to change the name for the command to work, e.g. "eye".


____
2D vector animator since 2000 & PhD
Translate
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 ,
Jun 12, 2022 Jun 12, 2022
LATEST

don't change anything.  you just call selecLayerF passing the layer name you want selected. eg, selectLayerF("eye")

Translate
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