Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions That ‘PointAt’ expression that was removed years ago – what’s the replacement again?

  • That ‘PointAt’ expression that was removed years ago – what’s the replacement again?

    Posted by Paul Roper on August 10, 2012 at 6:20 pm

    Huh. That’s quite a coincidence. I just saw the next-oldest-post in this forum was someone re-asking a question that was answered by Dan years ago…I’m in the exact same situation.

    Many years ago Adobe got rid of the incredibly useful PointAt expression command, so any layer could be made to rotate to align with anything else. I moaned about this, and Dan Ebberts came to my rescue with a bit of trigonometry to save the day. But I’ve completely forgotten what the expression was, and have been trawling through various fora to find the answer, but most people want stuff more complex, such as camera alignment in 3D space.

    I just need the rotation of a layer to be controlled by two points in space. So I have Null1 and Null2, and I want LineLayer to align itself between these nulls. Any suggestions would be VERY welcome!

    Thanks in advance!

    Paul

    Paul Roper replied 14 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 10, 2012 at 7:30 pm

    2D? This should give you the angle create by the line from Null 1 to Null 2:

    p1 = thisComp.layer(“Null 1”).transform.position;
    p2 = thisComp.layer(“Null 2”).transform.position;
    d = p2 – p1;
    radiansToDegrees(Math.atan2(d[1],d[0]))

    Dan

  • Paul Roper

    August 10, 2012 at 9:48 pm

    Fantastic as ever, Dan! Thank you – it worked perfectly!

    – Paul

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