ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression for displaying currently displayed footage name?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dominix
Expression for displaying currently displayed footage name?
on Aug 24, 2005 at 6:51:14 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.


Return to posts index

Dan Ebberts
Re: Expression for displaying currently displayed footage name?
on Aug 24, 2005 at 7:20:12 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


Return to posts index

Dominix
Re: Expression for displaying currently displayed footage name?
on Aug 24, 2005 at 8:30:26 pm

Wow...Thank you...



Return to posts index


Steve Freebairn
Re: Expression for displaying currently displayed footage name?
on Aug 25, 2005 at 2:51:21 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/


Return to posts index

Steve Roberts
Re: Expression for displaying currently displayed footage name?
on Aug 25, 2005 at 3:08:11 pm

I save all of Dan's posts.

Just in case. :)

Steve


Return to posts index

Joel Corkin
Re: Expression for displaying currently displayed footage name?
on Sep 20, 2005 at 6:56:36 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?



Return to posts index


Joel Corkin
Re: Expression for displaying currently displayed footage name?
on Sep 20, 2005 at 6:07:01 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!



Return to posts index

Joel Corkin
Re: Expression for displaying currently displayed footage name?
on Sep 20, 2005 at 6:31:57 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?



Return to posts index

Joel Corkin
Re: Expression for displaying currently displayed footage name?
on Sep 20, 2005 at 6:51:41 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;



Return to posts index


Amy Young
Re: Expression for displaying currently displayed footage name?
on Dec 7, 2017 at 8:52:38 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


Return to posts index

Nate Vander Plas
Re: Expression for displaying currently displayed footage name?
on Mar 6, 2018 at 3:50:18 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?



Return to posts index

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