FORUMS: list search recent posts

Select a specific layer in the timeline panel

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rudy Lee
Select a specific layer in the timeline panel
on Dec 4, 2017 at 9:26:40 am

Hi,

I am not sure whether this possible but I'll just ask.

Does anyone know how to select a specific layer after opening the root comp in the viewer ? Basically, I want to be able to select and cut a specific layer. See the image below:



This is the code that I have so far

pal.btn1.debugBtn.onClick = function ()
{
var file = importFile()

var layer = file.layer(2)

app.project.showWindow(true);

file.openInViewer()

layer.selected = true

app.executeCommand(18)
};


Return to posts index

Walter Soyka
Re: Select a specific layer in the timeline panel
on Dec 4, 2017 at 5:41:00 pm

When you open a comp in the viewer, it becomes the "active item" in After Effects. You could then select the third layer like this:

// deselect all layers in the active comp -- just in case
for (var i = 1; i <= app.project.activeItem.numLayers; i++) {
app.project.activeItem.layer(i).selected = false;
}

// select the third layer of the active comp
app.project.activeItem.layer(3).selected = true;


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Rudy Lee
Re: Select a specific layer in the timeline panel
on Dec 4, 2017 at 6:46:46 pm

Hi Walter,

That works, thank you so much for the help.

Rudy


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]