Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Trigger the change of the text source

  • Trigger the change of the text source

    Posted by Matej Vazal on January 7, 2022 at 3:05 pm

    Hi all!

     

    I would like to change text source of the same layer every time it hit the layer marker. (without keyframes)

     

    I want this text layer to pull data from other text layers in the composition.

     

    I can’t figure out how to write an expression where it will be defined that:

    First marker should change the text source: (link to text layer 01)

    Second marker should change the text source: (link to text layer 02)

    And so on…

     

    Does that make sense?

    Thank you very much in advance!

    Matej Vazal replied 4 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    January 7, 2022 at 3:50 pm

    One way would be to put the text layers in order (from top to bottom), then add this expression you the layer that needs to change its value. It will have the value of the first layer form the inPoint and then change to the second layer when encounter the first maker and so on.

    firstLayerIndex = 1;
    idx = marker.nearestKey(time).index;
    if(marker.key(idx).time > time) idx--;
    thisComp.layer(firstLayerIndex+idx).text.sourceText
  • Matej Vazal

    January 9, 2022 at 1:27 am

    Andrei,

    you are amazing! Thank you so much!

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