Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression for displaying currently displayed footage name?

  • Expression for displaying currently displayed footage name?

    Posted by Dominic Tremblay on August 24, 2005 at 6:51 pm

    Soory for the duplicate post post, I thought I would use a more self-explanatory title..:)

    Hi!

    Here is what I would like to do, have a comp filled with an edit of a bunch of clips and have atext lyer on top that gives me the name of the currently displayed clip. I’m able to get one footage name to link to the source text but is there a way to tell the expression to look for the currently displayed footage name?

    Thanks!

    D.

    Nate Vander plas replied 8 years, 1 month ago 7 Members · 10 Replies
  • 10 Replies
  • Dan Ebberts

    August 24, 2005 at 7:20 pm

    Try this source text expression:

    
    txt = "";
    for (j = 1; j <= thisComp.numLayers; j++){
      if (j == index) continue;
      L = thisComp.layer(j);
      if (! (L.hasVideo && L.active)) continue;
      if (time >= L.inPoint && time < L.outPoint){
        try{
          txt = L.source.name;
        }catch(err1){
          txt = L.name
        }
        break;
      }
    }
    txt
    
    

    Dan

  • Dominic Tremblay

    August 24, 2005 at 8:30 pm

    Wow…Thank you…

  • Steve Freebairn

    August 25, 2005 at 2:51 pm

    Dan Ebberts has to be the very best expressions person in the world. He responds to everyone and has his own great site that has taught me a ton, you should check it out. http://www.motionscript.com/

  • Steve Roberts

    August 25, 2005 at 3:08 pm

    I save all of Dan’s posts.

    Just in case. 🙂

    Steve

  • Joel Corkin

    September 20, 2005 at 6:56 am

    Sorry, I am trying to get this to work, but am having some trouble. Don’t I just need to paste Dan’s code into an expression for the SourceText property of a text layer?

  • Joel Corkin

    September 20, 2005 at 6:07 pm

    I figured out that this code only works if you have one text layer in your comp. Anyone know how it could work while other text layers are present? Dan?

    Thanks!

  • Joel Corkin

    September 20, 2005 at 6:31 pm

    Perhaps there is some way tell AE to do either of the following in the case of wanting to use additional text layers in your comp:

    – Disregard any other layer if it is a text layer
    or
    – Disregard all layers above the layer to which you are applying this particular sourceText code.

    Any thoughts?

  • Joel Corkin

    September 20, 2005 at 6:51 pm

    Okay, first, sorry for so many follow-up posts, but I figured out a way to make this work while disregarding certain other layers, like other text layers that span the whole comp for example.

    I added &&!L.hasParent into Dan’s code and then created a null layer with visibility off, which I used as the parent to whatever other text layers I want to add to the comp. This way the other text layers can span the comp without interfering with the footage name display.

    The modification of Dan’s code is below. If anyone has a better way than this, please post it.

    txt = “”;
    for (j = 1; j <= thisComp.numLayers; j++){ if (j == index) continue; L = thisComp.layer(j); if (! (L.hasVideo && L.active &&!L.hasParent)) continue; if (time >= L.inPoint && time < L.outPoint){ try{ txt = L.source.name; }catch(err1){ txt = L.name } break; } } txt;

  • Amy Young

    December 7, 2017 at 8:52 pm

    Small update to show the active layer’s number, rather than source name . (I have a clip that appears in a few places on different layers, so having the layer number is more useful for me in one case…) Thanks Dan!

    txt = "";
    for (j = 1; j &lt;= thisComp.numLayers; j++){
    if (j == index) continue;
    L = thisComp.layer(j);
    if (! (L.hasVideo && L.active)) continue;
    if (time >= L.inPoint && time &lt; L.outPoint){
    try{
    txt = "Layer " + L.index;
    }catch(err1){
    txt = L.name // L.source.name
    }
    break;
    }
    }
    txt

  • Nate Vander plas

    March 6, 2018 at 3:50 pm

    This is cool! Makes me think Adobe should include options for HUD elements like this by default, similar to Cinema 4D. This expression would be much more useful to me if it could ignore certain types of layers, such as nulls, solids, lights, cameras, etc. Maybe it could work with checkboxes to only show the types you have checked?

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