Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Generate text markers.

Community Beginner ,
Jun 21, 2020 Jun 21, 2020

Hi...
I'm wondering if there's an expression to generate text from markers (marker's comment). Capture.PNG
In this snapshot's case, I want an expression (or any way) to generate the words from the marker layer (Null 1) so when the CTI reaches the first marker, the first word appears and stays, then the next word until there's no more markers.
In short, I want my text layer to be triggered word by word by the markers in the Null layer.
Can someone tell me what I should do, please?

Thanks.

TOPICS
Expressions , How to , Scripting
774
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2020 Jun 21, 2020

Well, have you in fact even just tried? The .marker functions are well enough documented even in the online help, rudimentary as it may be on expressions otherwise, and are simple enough to use and your requirement is literally as basic as it gets - looping through the markers, comparing the current time and adding up the text strings when the time is greater than the most recent marker's time. Start here:

 

https://helpx.adobe.com/after-effects/using//expression-language-reference.html#markerkey_attributes...

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 21, 2020 Jun 21, 2020

Hi...
Thanks for replying but I didn't really understand the link you provided because I am new to expressions. I understand that the expression has to loop through the markers but I am cluelesss since I do not know where to begin or even where to add the expression.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 21, 2020 Jun 21, 2020

This expression will display a text layer marker's Comment text. If more than one marker is on the layer the displayed text will change when the new marker is reached.

m = marker;
i = m.nearestKey(time).index;

if (m.nearestKey(time).time > time){ i--;}
if (i < 1) { i = 1};

mrkrName = m.key(i).comment

 You could also define m as a marker on another layer by just pointing to the layer with the pickwhip and adding .marker to the variable definition.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 21, 2020 Jun 21, 2020

Oh man... Thank you.
But I actually wanted the text to stay after it appears something like the automatic generated Youtube subtitles.
P.S where do I apply the expression? The "source text"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 21, 2020 Jun 21, 2020

The text in the markers staus visible until the next marker appears on the layer. That expression is the closest thing you can get to automated subtitles in After Effects. 

 

If you want to put the marker on a Null layer and then apply the marker's contents to a text layer all you have to do is change the first line of the expression. 

m = thisComp.layer(index - 1).marker;
i = m.nearestKey(time).index;

if (m.nearestKey(time).time > time){ i--;}
if (i < 1) { i = 1};

mrkrName = m.key(i).comment

As long as the null with the markers is one layer above the text layer this work. This prevents any problems caused by layer names. 

 

What, exactly, are you trying to do? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 21, 2020 Jun 21, 2020

text_appear_word_by_word.png

1) add a text animator for the opacity of the text and set the opacity of the animator to 0.

2) for the range selector of the animator set units to "Index" and "Based on" to "Words".

3) if you now increase the "Start" of the range selector one by one, the words will appear one by one

4) apply an expression to the "Start" that increments at each marker by one. You can use this iExpression for that https://mamoworld.com/after-effects-expression/increment-marker-1d


iExpressions is available here

https://aescripts.com/iexpressions/

 

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 23, 2020 Jun 23, 2020
LATEST

Thank you Mathias...
I already found what I was looking for. I'll add your solution to mine.
One too many expression can't harm, right?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines