ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Mark names to text layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Fernando Mol
Mark names to text layer
on Jul 25, 2010 at 8:28:44 pm

Hi, guys.

I was wondering if there's a way to get the text from markers and place it as the source of a text layer.

Thanks in advance

*Always share a link to your site and rate the posts. This is a free service for you and for us.


Return to posts index


Dan Ebberts
Re: Mark names to text layer
on Jul 25, 2010 at 8:45:23 pm

Try this:


txt = value;
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
if (n > 0) txt = marker.key(n).comment;
}
txt


Dan



Return to posts index

Fernando Mol
Re: Mark names to text layer
on Jul 27, 2010 at 6:32:13 pm

It worked great!

I tweak it a little to access the comp marks.

txt = value;
n = 0;
if (thisComp.marker.numKeys > 0){
n = thisComp.marker.nearestKey(time).index;
if (thisComp.marker.key(n).time > time) n--;
if (n > 0) txt = thisComp.marker.key(n).comment;
}
txt


Thank you very much, Dan.

*Always share a link to your site and rate the posts. This is a free service for you and for us.


Return to posts index


Ian Hagerty
Re: Mark names to text layer
on Mar 6, 2013 at 4:42:17 am

How does one go about using the above script to extract the text from the marker and use it as text on the screen? Where do you enter this expression? Thanks for you time... Ian


Return to posts index

Dan Ebberts
Re: Mark names to text layer
on Mar 6, 2013 at 7:15:41 am

The expression assumes that the markers are on a text layer and the expression is applied to the text layer's source text property.

Dan



Return to posts index

Ian Hagerty
Re: Mark names to text layer
on Mar 6, 2013 at 6:56:28 pm

Thanks Dan for getting back to me (much appreciated). Ian


Return to posts index


Joel Ashman
Re: Mark names to text layer
on May 12, 2011 at 8:32:59 pm

Hi Dan, I had a question regarding this. How would I create a script for the source text parameter of a text layer that spans an entire composition to print the layer names of all the layers below it that have specific in and out points. So each time the playhead reaches a new layer in the composition the text dynamically changes to reflect the current layer being read by the playhead?

Your help would be extremely helpful.

I know this:

thisComp.layer(index + 1).name

gives me what I want for the first layer below my text layer but I need it to update based on the in and out points of various layers in my composition (there are no overlapping layers)

Thanks


Return to posts index

Dan Ebberts
Re: Mark names to text layer
on May 12, 2011 at 11:37:37 pm

This should help:

http://www.motionscript.com/design-guide/source-name.html


Dan



Return to posts index

Joel Ashman
Re: Mark names to text layer
on May 13, 2011 at 2:31:32 am

Thanks Dan, you are a lifesaver!!!


Return to posts index


ruben Langedijk
Re: Mark names to text layer
on Jun 15, 2018 at 12:44:40 pm

Hi Dan 'the man'

How would you add time limit to this expression?

For instance i want to display the text for 1,5 seconds after the marker is hit and then (optional fade out for 1 second)


Return to posts index

Dan Ebberts
Re: Mark names to text layer
on Jun 15, 2018 at 4:36:38 pm

I guess you could add an opacity expression like this:


n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0){
t = time - marker.key(n).time;
ease(t,1.5,2.5,100,0)
}else
0



Dan



Return to posts index

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