Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Parenting FOCUS point to object!

  • Parenting FOCUS point to object!

    Posted by Editing-jos on February 15, 2006 at 2:18 am

    I want to parent the distance of the Focus from the camera to a position of an object/null.

    This must be done by an expressoin. I’m just such a java noob! Can someone help me write it?
    So the expression has to give out a distance between the “CAMERA position vs Object/null”.

    Regards and thanks.

    Evan Seccombe replied 19 years, 8 months ago 4 Members · 4 Replies
  • 4 Replies
  • Editing-jos

    February 15, 2006 at 2:23 am

    I got this for Motionscript.com. Great site btw.
    I think I just have to change some stuff here.
    If you can help plz do. 🙂

    factor = 150;
    C = thisComp.layer(“Camera 1”);
    L = thisComp.layer(“Light 1″);
    d = length(C.position,L.position);
    d1 = length(C.position,L.position.valueAtTime(0));
    d1/d*factor

    This expression calculates the initial distance between the light and the camera (d1), divides that by the current distance between the light and the camera (d) and multiplies that by the maximum value of flare brightness that we want (factor).

    So there you have it. A pretty nice effect implemented with very little code.”

  • Colin Braley

    February 15, 2006 at 2:50 am

    If all you want is to make the focus distance be equal to the distance between a camera and a null all you need to do is add this expression to focus distance:

    nullLayer = thisComp.layer(“Null Object”);
    length(this.position, nullLayer.position)

    adjust the name of the layer “Null Object” and you should be set.

    ~Colin

  • Mike Clasby

    February 15, 2006 at 2:53 am

    For more magic by the same author click on Dan’s head at the top of the page, then scroll down to “Building the World’s Greatest Cameraman”.

  • Evan Seccombe

    August 15, 2006 at 3:29 am

    hey i have a question along same thing, (and yes, totaly expression/java noob with no idea what im doing) how do i go about llinking a cameras focus distance to an object so that when i move the camera around it, it will stay in focus?

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