Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Parenting an Angle control to 3D layer position

  • Parenting an Angle control to 3D layer position

    Posted by Jonny Law on October 26, 2018 at 5:14 am

    As the Subject states,

    I’m attempting to parent a 2D effect that uses an Angle control (e.g. Bevel Alpha, Drop Shadow) to a 3D light’s position.

    Is there an expression setup that will allow me to dynamically affect the results even when the 3D light’s position moves around the comp?

    Jonny Law replied 7 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kalleheikki Kannisto

    October 30, 2018 at 5:41 pm

    I can’t do it off the top of my head, but the idea is to get the 2D position of the 3D layer, and the reference position of the layer with the effect on it (likely to be the anchor point), then calculate the angle between the two points. You can find the expressions for both of these — at least separately — in this forum, and just need to combine them.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Filip Vandueren

    October 30, 2018 at 10:59 pm

    This seems to work, though I haven’t tested it rigorously

    l=thisComp.layer("Point Light 1");
    pos = fromCompToSurface(l.toComp([0,0]));
    ang = Math.atan2(pos[1],pos[0]);

    -radiansToDegrees(ang);

  • Jonny Law

    November 1, 2018 at 3:52 am

    This works with pretty darn close accuracy!

    Personally I’ve never used the fromCompToSurface expression before, but I’ll keep this little gem in mind next time.

    Thanks, Filip & Kalleheikki!

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