Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Rotation and revolutions

  • Rotation and revolutions

    Posted by David Garces on February 25, 2018 at 3:24 am

    Hi people, can some hero help me write a correct expression for my project?

    The animation is a guy on a bicycle. I want the position of the rigged shoulders to be determined by the angle of rotation.

    The thing is that the angle keeps adding up because the pedal keeps increasing the revolutions. I’ve tried this under a slider controller with no results:

    Thank you very much.

    COUNTER = 0;
    ROTBICI = thisComp.layer("BICI").transform.rotation +(360*COUNTER);

    if(ROTBICI<=-360)COUNTER+1; linear(ROTBICI ,0 ,-360, -360, 0);

    David Garces replied 8 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 25, 2018 at 3:32 am

    I’m not sure what you want the relationship to be between the shoulders and the pedal rotation, but you can get the rotation value between 0 and 360 like this:

    thisComp.layer(“BICI”).transform.rotation%360;

    I’m not sure if that helps though.

    Dan

  • David Garces

    February 25, 2018 at 3:40 am

    I want the shoulders to move forward when the pedal is from 0° to180° and to move backwards from 180° to 360°.
    (I have the degrees in negative in my comp).
    What I try to achieve with my code is subtracting 360*revolutions each time it moves a whole cycle, but I’m sure it’s a lot easier than that.

  • David Garces

    February 25, 2018 at 3:49 am

    Can’t believe it was that easy.
    Thank you so much.
    Really appreciated.

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