Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Rotation property

  • Posted by David Gaslain on July 5, 2013 at 3:53 pm

    Long time reader, first time poster!

    I have a quick question about the rotation property of a layer.
    Is it possible to use an expression to ignore the number of rotations and return values constrained between 0-360?
    For example, if the actual rotation value is 720 or 1260 etc., I would like to convert it to 360.
    I appreciate your help!

    Best regards,
    David

    Darby Edelen replied 13 years, 2 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    July 5, 2013 at 5:08 pm

    Just use the modulus operator (%):

    newValue = yourRotationValue%360;

    Dan

  • David Gaslain

    July 5, 2013 at 5:26 pm

    Simple enough! Thank you very much Dan.

  • Darby Edelen

    July 5, 2013 at 6:12 pm

    Word of warning:

    If you’re applying this to a layer that has motion blur enabled when the layer rotates beyond the 0-360 degree range it will snap back around 360 degrees across one frame and you’ll get a big blurry spin on that frame.

    Darby Edelen

  • David Gaslain

    July 5, 2013 at 6:42 pm

    Good to know Darby! Since you seem to be talking from experience, have you found any workaround to this issue?

  • Darby Edelen

    July 5, 2013 at 6:51 pm

    Well, turns out I lied 🙂 I’ve run into problems like this with other similar expressions. In this case it looks like there is no problem with this expression and motion blur.

    Happy motion blurring! 🙂

    Darby Edelen

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