Activity › Forums › Adobe After Effects Expressions › Mark names to text layer
-
Mark names to text layer
Posted by Fernando Mol on July 25, 2010 at 8:28 pmHi, 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.
Dan Ebberts replied 7 years, 11 months ago 5 Members · 10 Replies -
10 Replies
-
Dan Ebberts
July 25, 2010 at 8:45 pmTry 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
-
Fernando Mol
July 27, 2010 at 6:32 pmIt 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;
}
txtThank 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.
-
Joel Ashman
May 12, 2011 at 8:32 pmHi 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
-
Dan Ebberts
May 12, 2011 at 11:37 pm -
Ian Hagerty
March 6, 2013 at 4:42 amHow 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
-
Dan Ebberts
March 6, 2013 at 7:15 amThe expression assumes that the markers are on a text layer and the expression is applied to the text layer’s source text property.
Dan
-
Ruben Langedijk
June 15, 2018 at 12:44 pmHi 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)
-
Dan Ebberts
June 15, 2018 at 4:36 pmI 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
Reply to this Discussion! Login or Sign Up