Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects parenting focus distance to null.

  • parenting focus distance to null.

    Posted by Malcolm Desoto on December 7, 2007 at 6:41 pm

    Okay, I’m still a bit inexperienced when it comes to expressions.

    I’m trying to parent a camera’s Focus Distance property to a Null Objects Position property.

    I alt + clicked on the camera’s fd property and linked it to the Null Position Property.

    I thought that would do it.

    Obviously I’m missing something.

    A little help?

    Sam Moulton replied 18 years, 5 months ago 4 Members · 5 Replies
  • 5 Replies
  • Malcolm Desoto

    December 7, 2007 at 6:54 pm

    Okay, the focus distance seems to be parented to the null’s position, but only it’s X space.

    When I move the null side to side, the fd value will change; but not when I move it in Z space, which is what I really need it to respond to.

  • Jason Milligan

    December 7, 2007 at 7:18 pm

    Your expression probably looks something like this:
    thisComp.layer(“Null 1”).transform.position[0]

    Change it to this:
    thisComp.layer(“Null 1”).transform.position[2]

    The reason:
    0=x 1=y 2=z

    Make sure you have your null set as a 3D object

  • Malcolm Desoto

    December 7, 2007 at 7:55 pm

    Ahhhhhhhhh, thanks! Changing the position to “2” makes sense.

    Thanks!

  • Darby Edelen

    December 7, 2007 at 9:56 pm

    The other problem you will have is that a layer that is near the edge of the frame will be farther from the camera than a layer that is at the center of the frame, even if they have the same Z position.

    Here’s an expression from Dan Ebberts to correct for this:

    https://www.motionscript.com/design-guide/auto-focus.html

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

  • Sam Moulton

    December 11, 2007 at 5:07 am

    as long as the null is at the same point as the point of interest you can simply use the length arguement:

    length(position, thisComp.layer(“Null 1”).transform.position)

    if the null is not then you need to use a little more complicated expression like the one Master Dan has on his site.

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