Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Showing the name of a layer (via Expression?)

  • Showing the name of a layer (via Expression?)

    Posted by Marius Shekow on July 24, 2008 at 4:55 pm

    Hello,

    I’m having a lot of clips which are basically named like < number >.avi

    I put all these clips into after effects so that they come one after another, applied some effects (using an adjustment layer) and rendered them again (after rendering they have less FPS and a smaller resolution, I do this to have some kind of “preview”, a movie that has all the single clips in).

    I’m looking at the compilation of clips (the thing I rendred out of AE) from time to time using a video player in order to find some scenes I like to use later in another movie. However, to be able to identify them I’d like to have the name of the corresponding layer printed in the corner somewhere, so that I instantly know which scene avi file it is while looking at it. Is there any way to di this in after effects?

    Some idea I have in mind is that I prepare one effect which, once applied to a layer, shows the name of that layer in the corner of the scene, and that I just have to copy that effect and apply it to every layer. I just couldn’t figure it out how to do that using Expressions and the like.

    Thanks for your help,
    Marius

    Marius Shekow replied 18 years, 1 month ago 2 Members · 5 Replies
  • 5 Replies
  • Kevin Camp

    July 24, 2008 at 8:01 pm

    you could create a text layer above the clip with an expression in the source text that would pull the name of the layer bellow it. the expression is simple:

    thisComp.layer(index+1).name;

    does this do what you need it to do?

    you can set any other text attributes as needed (size, color, outline, even shadow, etc)

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Marius Shekow

    July 24, 2008 at 9:19 pm

    Hi,

    well, unfortunately this will only show the name of the very first layer underneath the text layer. But I’d need the text to change each time a new clip is played.

    To make it more clear: my timeline looks like this

    To use your trick would mean that I’d have to place that text layer above every avi clip, and to also manually trim the text layers so that the texts don’t overlap. That’s the reason why I proposed to rather use an effect for this, because this will avoid that I’ll have to trim things manually (I’d consider it “manual” trimming even though there are keyboard shortcuts that make it faster).

    Your solution is of course still faster than creating these texts all manually!).

    However, I’m still looking for a ideal solution, maybe something like:
    – don’t always take the next layer (own index + 1) but the first one that is active at the corresponding point of time, dunno if this is doable in the expression language
    – an effect where I can keyframe the text

  • Marius Shekow

    July 25, 2008 at 6:42 am

    Hello again!

    I think that I will be able to solve that problem rather easily, thanks to your solution, Kevin. I could simply add one of these expression controls (e.g. a slider or something like that) and increment its value each time a new avi clip starts. This way I will only need one text layer, and I won’t need to trim it either. And the effort of placing a keyframe at every inpoint of a avi clip layer is just about the same as when I had to apply (copy) an effect to all layers in the composition.

  • Kevin Camp

    July 25, 2008 at 2:18 pm

    sorry i miss understood what you needed. i’m glad it sounds like you got it to work.

    there is another expression that does exactly what you were looking for:

    txt = “”;
    for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; L = thisComp.layer(i); if (! (L.hasVideo && L.active)) continue; try{ txt = L.source.name; }catch(err){ txt = L.name } break; } txt

    i found it here on dan ebbert’s motionscript.com if you want to read the full breakdown on what the expression does…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Marius Shekow

    July 25, 2008 at 6:47 pm

    awesome, this is 100% what I needed. And it works fine 😉

    Thanks a lot for this hint !

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy