Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing Parameters based on Distance from Camera?

  • Changing Parameters based on Distance from Camera?

    Posted by Todd on July 7, 2007 at 10:19 pm

    Thanks to the previous help on these forums I’ve got a ring of layers orbiting around a center null. Because they are parented, on orbit, their position doesn’t change.

    I’d like to create an expression that can modify lets say opacity and a fast blur based on each layers position from the camera. The camera is stationary and the farther away from the camera (fixed point is max distance) I would like the more transparent and more blurry.

    DOF works, although the blur isn’t as nice as a gaussian or fast blur would be so I’m thinking of using that instead and turning DOF off.

    Anyone have a starting point for me to mess around with?

    Darby Edelen replied 18 years, 10 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 7, 2007 at 10:41 pm

    Here’s an example for opacity. You’ll need to adjust the parameters to fit your situation:

    minDist = 600;
    maxDist = 800;
    minOpacity = 30;
    maxOpacity = 100;

    d = length(toWorld(anchorPoint),thisComp.activeCamera.position);
    linear(d,minDist,maxDist,maxOpacity,minOpacity)

    Dan

  • Darby Edelen

    July 9, 2007 at 5:35 pm

    [todd] “DOF works, although the blur isn’t as nice as a gaussian or fast blur would be”

    Or a Box Blur for that matter (;

    I’d stay away from Gaussian Blurs, they’re not that pretty and they take a lot more time to render.

    A Box Blur with iterations at 3 or 4 is almost exactly the same as a Fast Blur, but it gives you the ability to fine tune the blur for your needs (fewer iterations = faster render, more boxy blur, more iterations = longer render, less boxy blur)!

    Darby Edelen
    DVD Menu Artist
    Left Coast Digital
    Aptos, CA

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