Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects fade in and out without keyframe

  • fade in and out without keyframe

    Posted by Ryan Chan on December 10, 2007 at 12:10 pm

    hello, did anybody know how to use expression to make the layer fade in from the in point and fade out before the out point, or even fade in from the in point then fade out from the 1st marker point and fade in again from the next marker point?
    thanks
    ryandrew

    Bruce Walker replied 18 years, 4 months ago 6 Members · 7 Replies
  • 7 Replies
  • Mike Derk

    December 10, 2007 at 4:23 pm

    You could probably put a layer over the one you’re fading in and out, and then use that to obscure the layer below it. It would look like a fade in/fade out… but you’d have to do that with keyframes too.

    Any particular reason you’re doing it this way?

  • Mike Clasby

    December 10, 2007 at 5:57 pm

    Here is a Dan expression to do what you want; change times as needed:

    fadeInTime = 1; // fade in time (seconds)
    fadeOutTime = 1;

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

    Make a preset for mass application.

  • Ross Gerbasi

    December 10, 2007 at 6:07 pm

    Here ya go, this isn’t marker based, but time based. So change the “fade_in_time” and “fade_out_time” to whatever you want, they are in seconds. So in this case it will take 1 second from the inPoint to fade in, and 1 second from the outpoint to fade out

    var fade_in_time = 1;
    var fade_out_time = 1;
    var ratio = 1;

    if(time <= inPoint + fade_in_time){ ratio = (time - inPoint) / fade_in_time }else if(time >= outPoint – fade_out_time){
    ratio =Math.abs((time – outPoint) / fade_out_time);
    }

    100 * ratio;

    ————-
    If you really wanna be organized I would create two sliders on a Null layer. Then parent the values to those sliders. That way you can use the same expression on as many layers as u want, and have global control over the fading. The expression would look like this. If you named your null “Fade Controller” and the sliders “Fade In Time” and “Fade Out Time”

    var fade_in_time = thisComp.layer(“Fade Controller”).effect(“Fade In Time”)(“Slider”)
    var fade_out_time = thisComp.layer(“Fade Controller”).effect(“Fade Out Time”)(“Slider”)
    var ratio = 1;

    if(time <= inPoint + fade_in_time){ ratio = (time - inPoint) / fade_in_time }else if(time >= outPoint – fade_out_time){
    ratio =Math.abs((time – outPoint) / fade_out_time);
    }

    100 * ratio;

    hope this helps
    -ross

  • Ross Gerbasi

    December 10, 2007 at 6:10 pm

    oh man linear… duh… so much smarter… go with this one.

    -ross

  • Steve Roberts

    December 10, 2007 at 6:15 pm

    Continuing along Ross’ lines, here’s what I apply to Opacity:

    fade=this_comp.layer(“fade null”).effect(“fade length”).param(“Slider”);
    if (time < in_point+fade){ ease(time, in_point, in_point+fade, 0, 100) }else{ ease(time,out_point-fade, out_point, 100, 0) } This one requires a null layer called "fade null" with a slider control renamed "fade length". The slider changes the length of the fade. When we apply these expressions to layers, the fade automatically adjusts when we adjust the in/out point. If we used keys, we'd have to adjust in/out points and keyframes for each layer. These kinds of expressions can be timesavers when faced with a lot of layers spread throughout the comp. Don't forget to use "copy expression only" and "paste" to paste the expression where you need it. 🙂

  • Ryan Chan

    December 11, 2007 at 6:32 am

    thanks really much for your helps. the answer(expression solution) is also really inspiring too! cheers

  • Bruce Walker

    December 17, 2007 at 2:44 pm

    Hi All,
    long time reader, first time poster.
    First of all, thanks so much for all of your helpful thoughts, podcasts and postings. The Cowmmunity has saved my time-strapped rear-end on many occasions.
    So, here’s my question regarding sliders, expressions and opacity.
    I’m trying to do basically the same thing described in this thread, (control many layers’ opacity with one layer to avoid many keyframes, etc.)
    The only twist being I would like to stagger the fade up of my stack of lights and be able to control and adjust the timing to my whim, (using that all mighty control Null layer hopefully)
    I imagine that I just need to incorporate the expression “valueAtTime(time-X)” in there somehow.
    My expression chops aren’t very developed, but I’m trying.
    Thanks again for all your help,
    bruce

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