Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text-Layer-source-keyframe starts animation

  • Text-Layer-source-keyframe starts animation

    Posted by Marc Rühl on January 23, 2012 at 7:45 pm

    I try to find a way to animate subtitles in and out. Thanks to CreativeCow and Dan Ebberts I realized an Expression, which fades the Layer in at its in-point and out at it’s outpoint.
    Unfortunately now I don’t have multiple layers for every subtitle. I got just one text-layer, whose “source-text” is changing over time.
    Now I need an expression, which animates the transparency out and back in every time a keyframe is set in “source-text”.
    I searched the help, but I couldn’t find if it’s possible to get the time of different keyframes, instead of their value.

    I hope everything is clear, english isn’t my native language.

    Dan Ebberts
    replied 10 years, 3 months ago
    3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    January 23, 2012 at 8:27 pm

    Something like this opacity expression, probably:


    fadeTime = .3;

    txt = text.sourceText;

    if (txt.numKeys > 0){
    t = txt.nearestKey(time).time;
    if (time < t)
    ease(time,t-fadeTime,t,100,0)
    else
    ease(time,t,t+fadeTime,0,100);
    }else
    value

    Dan

  • Marc Rühl

    January 23, 2012 at 9:28 pm

    Wow, works exactly the way it should. Thank you a lot Dan!

    http://www.schwarzgrau.com

  • Alex Lancial

    January 28, 2016 at 7:16 pm

    Hi Dan,

    Love this expression, just wondering if I can change it so that instead of fading in and out every time, at the keyframe the opacity would be 100 and it would just fade out until another keyframe. Also, if the fade time is less than the amount of time in between keyframes, the opacity wouldn’t have to go all the way to 0 before the next keyframe was 100.

    I’m sorry if this isn’t clear, I basically want the text for each keyframe to pop in and fade out slowly.

  • Dan Ebberts

    January 28, 2016 at 8:02 pm

    Like this maybe:

    fadeTime = .3;
    txt = text.sourceText;
    if (txt.numKeys > 0){
    n = txt.nearestKey(time).index;
    if (time < txt.key(n).time) n–;
    if (n > 0){
    t = time – txt.key(n).time;
    ease(t,0,fadeTime,100,0);
    }else{
    0;
    }
    }else
    value

    Dan

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