ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Rotation and revolutions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Garces
Rotation and revolutions
on Feb 25, 2018 at 3:24:47 am
Last Edited By David Garces on Feb 25, 2018 at 3:26:31 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);


Return to posts index

Dan Ebberts
Re: Rotation and revolutions
on Feb 25, 2018 at 3:32:40 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



Return to posts index

David Garces
Re: Rotation and revolutions
on Feb 25, 2018 at 3:40:14 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.


Return to posts index


David Garces
Re: Rotation and revolutions
on Feb 25, 2018 at 3:49:11 am

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]