Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fade In/Out & Opacity Expression

  • Fade In/Out & Opacity Expression

    Posted by Jeff Horowitz on May 20, 2014 at 5:23 pm

    So I have two layers:
    Layer 1: text
    Layer 2: shape layer(text box)

    On Layer 2 I’ve added this expression to its opacity to tell the text box to disappear in the event that there is no text:

    thisComp.layer(1).text.sourceText.length>0?75:0

    I also want to add this expression to Layer 2 to tell the text box to fade in and out:

    fadeInTime = .5;
    fadeOutTime = .5;

    Math.min(linear(time,inPoint,inPoint + fadeInTime,0,75),linear(time,outPoint – fadeOutTime,outPoint,75,0))

    HOW CAN I USE BOTH EXPRESSIONS ON THE OPACITY OF THE SAME LAYER, SO I CAN HAVE THE TEXT BOX FADE IN AND OUT AND ALSO NOT APPEAR WHEN THERE’S NO TEXT?

    JAH

    Jason Valalik replied 11 years, 10 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    May 20, 2014 at 5:37 pm

    Something like this should work:


    fadeInTime = .5;
    fadeOutTime = .5;

    if (thisComp.layer(1).text.sourceText.length>0){
    if (time < (inPoint+outPoint)/2)
    linear(time,inPoint,inPoint+fadeInTime,0,75)
    else
    linear(time,outPoint-fadeOutTime,outPoint,75,0);
    }else
    0

    Dan

  • Jeff Horowitz

    May 20, 2014 at 5:47 pm

    I’ll see if this works and I’ll let you know. Thanks for responding so fast.

    JAH

  • Jeff Horowitz

    May 20, 2014 at 7:09 pm

    It worked perfectly, thanks again!

    JAH

  • Jason Valalik

    August 26, 2014 at 9:38 pm

    How can I loop this? I get the fade in and out, but I want it to loop on and off throughout.

  • Dan Ebberts

    August 26, 2014 at 11:19 pm

    Something like this maybe:


    fadeInTime = .5;
    fadeOutTime = .5;
    minVal = 0;
    maxVal = 75;
    if (thisComp.layer(1).text.sourceText.length>0){
    t = (time-inPoint)%(fadeInTime+fadeOutTime);
    if (t < fadeInTime)
    ease(t,0,fadeInTime,minVal,maxVal)
    else
    ease(t,fadeInTime,fadeInTime+fadeOutTime,maxVal,minVal);
    }else
    0

    Dan

  • Jason Valalik

    August 26, 2014 at 11:23 pm

    yep! That totally worked. Thanks

    What about if I wanted to show something like this.

    When it fades out have a new piece of text come in. So the user story would be that a customers airplane Gate Changed from say B5 to D10 and I want to have it flash/fade back in forth between the new and old gate?

    thanks

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