Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Rotation speed linked to motion return to zero

  • Rotation speed linked to motion return to zero

    Posted by Jason Jantzen on August 6, 2015 at 12:25 am

    I found this old expression from JJ Gifford’s website.

    Basically what I’d like to do is modify it so that my circles return to 0 when they’ve finished animating instead of ending up rotated all wonky. The circles are animating in the X position from point A to point B, then back again. Any thoughts?

    circumference=width*( scale[0]/100)*Math.PI;

    distance=position[0];

    (distance/circumference)*360

    Jason Jantzen
    vimeo.com/jasonj

    Jason Jantzen replied 10 years, 11 months ago 3 Members · 5 Replies
  • 5 Replies
  • Jürgen Hackl

    August 6, 2015 at 9:30 am

    Try this one:

    circumference=width*( scale[0]/100)*Math.PI;
    distance=position[0];
    rot = (distance/circumference)*360
    while (rot>360) {
    rot -=360;
    }
    [rot]

    – – –

    http://www.jxrgen.at

    SXPER RENDER – After Effects Render Script
    http://www.jxrgen.at/sxper-render-after-effects-script/

  • Jürgen Hackl

    August 6, 2015 at 9:37 am

    simpler:

    circumference=width*( scale[0]/100)*Math.PI;

    distance=position[0];

    (distance/circumference)*360 % 360

    – – –

    http://www.jxrgen.at

    SXPER RENDER – After Effects Render Script
    http://www.jxrgen.at/sxper-render-after-effects-script/

  • Jason Jantzen

    August 6, 2015 at 7:40 pm

    Thanks for taking a crack at it! But it still ends up settling in a wonky rotation angle.

    Jason Jantzen
    vimeo.com/jasonj

  • Dan Ebberts

    August 6, 2015 at 9:35 pm

    You might just need a reference position. Try changing you second line to this:

    distance=position[0] – position.valueAtTime(inPoint)[0];

    Dan

  • Jason Jantzen

    August 11, 2015 at 3:19 pm

    Thanks Dan, but that gets the circle to start at 0 degrees and then roll forward the appropriate amount. What I’m trying to do is get the circle to end on 0 degrees. That way I can inflect any amount of bounce back using just the position and not worry about getting the rotation right.

    Jason Jantzen
    vimeo.com/jasonj

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