Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Angle Measure expression

  • Josh Coleman

    May 26, 2013 at 10:11 pm

    Aha, that’s what i was doing!

    I was using the rotate option in the layers down the bottom rather than adjusting the starting and end points of the beam itself.

    Thank you very much, this will help me a lot!

  • Dan Ebberts

    May 26, 2013 at 10:19 pm

    This should work if the layers are rotated:

    L1 = thisComp.layer(“Beam Layer 1”);
    L2 = thisComp.layer(“Beam Layer 2”);
    beam1 = L1.effect(“Beam”);
    beam2 = L2.effect(“Beam”);
    v1 = L1.toWorldVec(beam1(“Ending Point”) – beam1(“Starting Point”));
    v2 = L2.toWorldVec(beam2(“Ending Point”) – beam2(“Starting Point”));
    radiansToDegrees(Math.acos(dot(normalize(v1),normalize(v2))))

    Dan

  • Josh Coleman

    May 26, 2013 at 10:45 pm

    Marvelous!

    I was just about to come back with a problem where the number wont change as the video goes on because the beams are parented to the Null which changes scale/position/rotation but not start and end points.

    Is there, by any chance, a simple way for the output to be to fewer decimal places? If not it’s ok as is.

    Thank you once again!

  • Dan Ebberts

    May 26, 2013 at 11:13 pm

    Just change the last line to this:

    a = radiansToDegrees(Math.acos(dot(normalize(v1),normalize(v2))))
    a.toFixed(2)

    Dan

  • Josh Coleman

    May 26, 2013 at 11:24 pm

    Thank you so much!

    Saved me a lot of pain and frustration.

Page 2 of 2

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