Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions An Expression for Opacity

  • An Expression for Opacity

    Posted by Ryan Carter on June 22, 2006 at 5:10 pm

    I know a little about expressions, but have forgot just about everything from my 1 semester of Java script. Here is my dilemma;

    I have a series of text layed out along the z axis. My camera is pulling through them and picks up speed. I want the text to fall off or fade out at a certain point as they fall off into the distance. I tried just linking the opacity to the cameras z position but they fade out too fast. Is there a way to control when to fall off and how slow this happens? Any tips would be appreciated. Thanks

    Ryan Carter replied 19 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 22, 2006 at 5:26 pm

    Something like this might be what you’re looking for:

    startFade = 1000;
    endFade = 2000;

    d = position[2] – thisComp.layer(“Camera 1”).position[2];
    linear(d,startFade,endFade,100,0)

    Dan

  • Ryan Carter

    June 22, 2006 at 6:47 pm

    This seemed to work great, Thanks! Could you talk me through what you did, I would like to comprehend it more?
    What does linear() do?

  • Dan Ebberts

    June 22, 2006 at 7:26 pm

    Sure. For reference, here’s the expression again

    startFade = 1000;
    endFade = 2000;

    d = position[2] – thisComp.layer(“Camera 1”).position[2];
    linear(d,startFade,endFade,100,0)

    The first two lines just set the z distance from the camera for the fade to start and end. The third line calculates the z distance from the camera.

    In English, the forth line just says “as d varies from 1000 to 2000, ramp opacity from 100 to 0”. At distances less than 1000 the opacity will be 100 at distances greater than 2000 the opacity will be 0.
    Instead of linear() you could try easeIn() and easeOut()

    Hope that helps.

    Dan

  • Ryan Carter

    June 22, 2006 at 7:36 pm

    I think I get it? Thanks alot for your help.

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