0
Create command to select the layer with a specific name.
Contributor
,
/t5/animate-discussions/create-command-to-select-the-layer-with-a-specific-name/td-p/12999755
Jun 12, 2022
Jun 12, 2022
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/create-command-to-select-the-layer-with-a-specific-name/m-p/13000055#M354761
Jun 12, 2022
Jun 12, 2022
Copy link to clipboard
Copied
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;
}
}
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
sergiopop75
AUTHOR
Contributor
,
/t5/animate-discussions/create-command-to-select-the-layer-with-a-specific-name/m-p/13000370#M354767
Jun 12, 2022
Jun 12, 2022
Copy link to clipboard
Copied
Where would I have to change the name for the command to work, e.g. "eye".
____
2D vector animator since 2000 & PhD
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/create-command-to-select-the-layer-with-a-specific-name/m-p/13000737#M354775
Jun 12, 2022
Jun 12, 2022
Copy link to clipboard
Copied
don't change anything. you just call selecLayerF passing the layer name you want selected. eg, selectLayerF("eye")
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

