Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression: Z position affects opacity

  • Expression: Z position affects opacity

    Posted by Pete on January 17, 2007 at 11:46 pm

    I have a row of layers (like a filing cabinent) that is moving in Z space (forwards and backwards). I would like to lower the opacity as the position of each layer moves away from the camera’s focal point. How do I do this???? Opacity should also lower as a layer goes towards the camera away from the focal point in the negative Z direction… Please help!

    Mike Clasby replied 19 years, 7 months ago 3 Members · 7 Replies
  • 7 Replies
  • Mike Clasby

    January 18, 2007 at 2:02 am

    If by Focal Point, you mean the camera’s Point Of Interest, this expression works for layers advancing and retreating (positive and negative) in the Z direction from the camera’s point of interest. Put this expression on the Opacity of each layer. Change the start and end Fades above to taste. This is a hackof A Dan Ebberts expression.

    startFade = 200;
    endFade = 400;

    POI = thisComp.layer(“Camera 1”).pointOfInterest[2]

    d = position[2] – POI;
    Math.min(linear(d,- endFade,- startFade,0,100),linear(d,startFade,endFade,100,0))

  • Pete

    January 18, 2007 at 2:35 am

    Is there a way to create a “master controller layer” that those values reference on each layer?

  • Steve Roberts

    January 18, 2007 at 2:47 am

    You could use a null, or apply a slider expression control to the null.

  • Pete

    January 18, 2007 at 2:58 am

    That just ranges the value from 0 to 100, how do you extend that to thousands?

  • Pete

    January 18, 2007 at 2:59 am

    That just ranges the value from 0 to 100, how do you extend that to thousands?

  • Steve Roberts

    January 18, 2007 at 3:06 am

    Hmm … value*1000 ? In other words, multiply the opacity by 1000 or some other factor?

  • Mike Clasby

    January 18, 2007 at 3:34 am

    If you’re talkng about the Min and Max Range of the slide, Right-Click the Blue Number (0 by default) and Choose “Edit Value”. Then type in the numbers you like for max and min, 1,000,000 is the max possible.

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