Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Camera POI following layer

  • Camera POI following layer

    Posted by Carl Parratt on September 26, 2007 at 4:56 pm

    Help, im new to expressions and have been doing ok looking through posts/tutorials etc for a little job that has 180 comps in a circle repeated 21 times high thats 3780 comps in moving aboutbut now i am stumped.
    I need my camera to follow a Null object whose position is constant but anchor point and rotation vary.

    I know its easy but my brain has started to melt down from expression overload these last few days and for some reason (probably lack of beer and sunlight) i cant do it arggghh

    any help would be apreciated

    any other code or advice for some groovy, follow with delay, motion/focus/zoom would be a real bonus

    thanks in advance

    this is my first post and just want to say how great this forum is, i have learnt much and been trully amazed at the results so thank you to all contributors.

    Carl Parratt replied 18 years, 10 months ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    September 26, 2007 at 6:42 pm

    I’m not clear on what you’re trying to do, but if you want your POI to match a specific point on your Null, you could do it like this to, for example, line up on the null’s center:

    L = thisComp.layer(“Null 1”);
    L.toWorld([L.width,L.height,0]/2)

    or like this for the upper left corner:

    L = thisComp.layer(“Null 1”);
    L.toWorld([0,0,0])

    Dan

  • Carl Parratt

    September 26, 2007 at 7:24 pm

    Dan you have made my day thank you

    Both do the job perfectly, its getting late and its great when it works, i can get on now,

    one last question please how do i lock the focus to the same object i tried:

    length(thisComp.layer(“Null 1”).position,position) no good
    length(thisComp.layer(“Null 1”).anchorPoint,position) almost

    target = thisComp.layer(“Null 1”);
    v1 = target.toWorld(target.anchorPoint) – toWorld([0,0,0]);
    v2 = toWorldVec([0,0,1]);
    dot(v1,v2)

    Zero?

    🙂

  • Dan Ebberts

    September 26, 2007 at 7:40 pm

    If you have the POI where you want focus to be, this should work:

    length(transform.pointOfInterest, toWorld([0,0,0]))

    Dan

  • Carl Parratt

    September 26, 2007 at 8:34 pm

    No im afraid not

    error says no transform property… i have tried a few things but… i missing somthing

  • Dan Ebberts

    September 26, 2007 at 10:52 pm

    Ah, AE 6.5. This should work:

    length(pointOfInterest, toWorld([0,0,0]))

    Dan

  • Carl Parratt

    September 27, 2007 at 6:11 am

    Dan, your the man,

    That works nicely, you have been a great help, I really appreciate you taking the time, deadlines are unforgiving. I’m going to be exploring expressions a lot more in the future, so i will probably bug you some more soon, i will certainly be keeping an eye on the forum.

    have a fantastic, crazy, creative, relaxing day 🙂 Im going to have somwe fun playing with pictures and making them dance 🙂

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