Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression that links fast blur to Camera position?

  • Expression that links fast blur to Camera position?

    Posted by Tara Devlin on October 6, 2016 at 7:25 pm

    Hi Everyone,

    Forgive me. I basically stumble my way around expressions and beg for help when I’m over my head. Does anyone have a quick expression that links fast blur to the distance or position of a camera – or can point me in the right direction?

    I found this but it’s not working quite like I need it to.

    // Blur from Distance to Camera
    dist = length(thisComp.layer(“Camera 1”).position, position);
    B = dist/100;
    [B]

    I attached it to the “Bluriness” of “Fast Blur” but the blur doesn’t seem to change when I move the camera around.

    The thing is, I have a ton of layers in z space spread out like a grid. The camera is flying around as some of these layers take center stage and others go back.. The ones that aren’t featured need to go out of focus a little. I can do it by hand, of course, but I think it would be much more realistic with an expression (not to mention less time consuming).

    Thank you all for any help!

    Best,

    Tara

    // Blur from Distance to Camera
    dist = length(thisComp.layer("Camera 1").position, position);
    B = dist/100;
    [B]

    Stefan Zerdzinski replied 7 years, 11 months ago 4 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    October 6, 2016 at 7:34 pm

    I’d think you might have better luck using the camera’s POI, like this:

    dist = length(thisComp.layer(“Camera 1”).transform.pointOfInterest, position);
    dist/100;

    Dan

  • Tara Devlin

    October 6, 2016 at 7:53 pm

    Thank you, Dan, for such a quick response! I don’t think that’s doing it for me either, unfortunately. I’m not using POI on my camera.

  • Kevin Camp

    October 6, 2016 at 8:33 pm

    I’ve used Dan’s light fall-off expression (slightly modified) for fake DOF…

    decay = .005;
    noBlur = 3000;

    L = thisComp.layer("Camera 1");

    d = length(L.transform.position,transform.position);
    if (d < noBlur){
    0;
    }else{
    (d - noBlur)*decay;
    }

    just change the decay and noBlur values as needed.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Stefan Zerdzinski

    May 24, 2018 at 1:46 pm

    Thank you for this from the distant future (2018). It helped out greatly.

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