Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Having opacity of objects be controlled by camera position

  • Having opacity of objects be controlled by camera position

    Posted by Matt Comradski on April 15, 2009 at 11:34 pm

    Greetings,

    I have scene where there are floating screens (all objects are 3d layers) with a camera. What I’d like to happen is the following… the closer I move the camera to any object, the more opaque it becomes. When the camera pulls away from it, the object becomes transparent. Let’s say, it never drops below 20% opacity and never goes over 90%.

    If this makes sense, please let me know if and how this is possible. I’m sure there’s an expression that controls it all, but I’m not very good at code. I did a search on the interwebs, but didn’t quite find the solution for what I need.

    Any help, links, tutorials, etc. are welcome! Thanks everyone,

    Redpandavfx

    John Carrington replied 17 years, 1 month ago 5 Members · 5 Replies
  • 5 Replies
  • Bob Root

    April 16, 2009 at 12:50 am

    Here’s something to start with. Copy and paste this code to your layer opacity.

    20+1.1*thisComp.layer(“Camera 1”).transform.position[2]

    As long as your camera’s z-position is greater than 0, you’ll get a minimum opacity of 20%. You can adjust the “1.1” property in the code to change the rate of opacity change in relation to camera distance.

    I’m not sure how to set the maximum opacity to 90%. I’m kind of a newbie to expressions.

    Hope this helps a little.

    Bob

  • Todd Kopriva

    April 16, 2009 at 1:16 am

    The example expression in the “Expression example: Fade opacity of a 3D layer based on distance from camera” section of After Effects Help should do what you want. Just replace the 100 and 0 in the last line with 90 and 20.

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    putting the ‘T’ back in ‘RTFM’ : After Effects Help on the Web
    ———————————————————————————————————

  • Roland R. kahlenberg

    April 16, 2009 at 2:32 pm

    Hi Todd, someone’s been messing with one of the links from the page that you provided – https://help.adobe.com/en_US/AfterEffects/9.0/WS3878526689cb91655866c1103906c6dea-7a16a.html

    The link is from the position between two layers thingy.

    Cheers
    RoRK

    broadcastGEMs – AEPro Volume 02 (Professional Adobe After Effects Project Files – Now Available).

    Adobe After Effects Training in South East Asia.

  • Matt Comradski

    April 16, 2009 at 2:50 pm

    You guys are awesome! Thank you very much… the combo of the above methods totally helped me.

    Super thanks!

  • John Carrington

    April 16, 2009 at 4:04 pm

    Andrew Kramer also has a neat preset called 3d Falloff on his website.

    https://www.videocopilot.net/tutorials/3d_falloff/

    it work pretty well, you might want to give that a shot

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