Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fade In and Out

  • Posted by Deepak Kumar on January 3, 2019 at 5:41 pm

    Can anyone Plz describe me How This Expression Work? When i Appy this Into Opacity it Makes Laye fade in and Fade Out I want To know physics behind it.

    i = linear(time, inPoint, inPoint+.5, 0, 100);
    o = linear(time, outPoint-.5, outPoint, 0, 100);
    i-o

    Dan Ebberts replied 7 years, 7 months ago 3 Members · 4 Replies
  • 4 Replies
  • Kalleheikki Kannisto

    January 3, 2019 at 6:02 pm

    Variable “i” gets its value from remapping the time value between the inpoint time of the layer and the inpoint time plus 0.5 seconds to the range of 0 to 100. Thus at inpoint the value of i is 0, from where it rises up to 100 in the following 0.5 seconds.

    Variable “o” gets it’s value similarly (in reverse) at the endpoint of the layer by remapping time from 0 to 100.

    When you subtract o from i you get both variables affecting the opacity.

    To understand the linear() function better, check it out in the AE expressions reference.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Deepak Kumar

    January 8, 2019 at 9:02 am

    Why Only subtract Works Perfect Why It Doesn’t when i do “i + o”

  • Kalleheikki Kannisto

    January 8, 2019 at 12:38 pm

    If you add the values then in the end it goes from 100 to 200, not 100 to 0.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dan Ebberts

    January 8, 2019 at 2:17 pm

    Here are a couple of other ways to do it that might make more sense (because the calculation for o goes in the direction you expect):

    i = linear(time, inPoint, inPoint+.5, 0, 100);
    o = linear(time, outPoint-.5, outPoint, 100, 0);
    Math.min(i,o)

    i = linear(time, inPoint, inPoint+.5, 0, 100);
    o = linear(time, outPoint-.5, outPoint, 100, 0);
    time < (inPoint+outPoint)/2 ? i : o

    Dan

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