Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Focus distance expresssion

  • Focus distance expresssion

    Posted by Evan Seccombe on August 15, 2006 at 3:32 am

    Im totalyl clueless on how java and expressions work, anyone know how i go about making one that can link a cameras focus distance to an object so it will always stay in focus while i have the camera moving in and out

    Mike Clasby replied 19 years, 9 months ago 3 Members · 3 Replies
  • 3 Replies
  • Colin Braley

    August 15, 2006 at 4:45 am

    I don’t have a computer that I can test this one on available right now but here goes:

    //–
    inFocusLayer = thisComp.layer(“A”);//Change A to whatever you want
    distance = length( inFocusLayer.position, this.position );
    distance
    //–

    Just add that expression in for focus distance and you should be set, as long as the layer inFocusLayer does not have a parent layer

    ~Colin

  • Evan Seccombe

    August 15, 2006 at 5:38 am

    yeah that seems to have done the trick, ill keep posted about any thing that might happen

  • Mike Clasby

    August 15, 2006 at 6:01 am

    Also, look at the last part of this tut by Dan, if you want to focus on another layer:

    Building the World’s Greatest Cameraman
    using After Effects 5.5’s Expression Controls

    https://www.creativecow.net/show.php?page=/articles/ebberts_dan/expression_cont/index.html

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