Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions 100 to 0 Expression based on layer length

  • 100 to 0 Expression based on layer length

    Posted by Adam Haas on October 29, 2018 at 7:48 pm

    I’ve been using this code for a while as a way to fade in and out my layers based on length, so I don’t have to keep moving keyframes when adjusting composition length:


    // Fade in and out

    fadeInTime = .25;
    fadeOutTime = .25;

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

    I tried to adapt the code and use it on the effect “Gradient Wipe” but it doesn’t seem to work:


    TransitionInTime = 1;
    TransitionOutTime = 1;

    Math.min(linear(time,inPoint,inPoint + TransitionInTime,100,0),linear(time,outPoint - TransitionOutTime,outPoint,0,100));

    I’m trying to have the transition go from 100 to 0 in one second at the beginning, and then 0 to 100 in one second at the end.

    I’m not sure why it isn’t working.

    Adam Haas replied 7 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 29, 2018 at 7:59 pm

    Change the last line from Math.min() to Math.max()

    Dab

  • Adam Haas

    October 29, 2018 at 9:13 pm

    YES, that was it! Thank you so much.

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