Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Get visible layer name at a specified time.

Community Beginner ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

I need to get the layer name at in comp in a specified second amount

So, if I wanted to have at 4 seconds, it would return the layer that is showing at 4 seconds.

Any hints?

TOPICS
Expressions

Views

53

Likes

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

correct answers 1 Correct answer

Adobe Community Professional , Apr 23, 2021 Apr 23, 2021
You can query the isActive() attribute in expressions and scripts. That's pretty much all you need. You still need to iterate through all layers, though. Given how AE works, there is no way to ensure it would automatically return only one reference even if the layers are stacked neatly. Mylenium

Likes

Translate

Translate
Adobe Community Professional ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

You can query the isActive() attribute in expressions and scripts. That's pretty much all you need. You still need to iterate through all layers, though. Given how AE works, there is no way to ensure it would automatically return only one reference even if the layers are stacked neatly.

 

Mylenium

Likes

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
Guide ,
Apr 23, 2021 Apr 23, 2021

Copy link to clipboard

Copied

LATEST

That's a little tricky. I think you could do it with 2 text layers that you would put at the top of your layer stack. The first one would be named "Name" and would get this source text expression:

txt = "";
for (i = index+1; i <= thisComp.numLayers; i++){
  L = thisComp.layer(i);
  if (! (L.hasVideo && L.active)) continue;
  txt = L.name;
  break;
}
txt

You would turn off the visibility eyeball for "Name". Above that (becoming Layer 1) you'd add another text layer with this source text expression:

t = 4;
thisComp.layer("Name").text.sourceText.valueAtTime(t)

This new text layer would display the value of the first text layer at whatever time you specify for vairable "t" (4 in this example). There may be a simpler way, but this should work.

 

 

 

 

Likes

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