FORUMS: list search recent posts

Convert rotation direction into a percentage?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sam Klejwa
Convert rotation direction into a percentage?
on Nov 7, 2014 at 7:31:31 pm

Hey guys!

So, I'm doing a day to night animated timelapse, one that speeds up exponentially as the comp goes on.

I have a sun and moon image parented to a null, which rotates, bringing them above the horizon line at 0 and 180 degrees respectively.

I also have two backgrounds, a day and night, one on top of the other.

I need to figure out an expression so that when the null is at 0 degrees, the opacity of the night layer is 0, and when it's at 180 degrees, the opacity is at 100

This works for a half rotation cycle with: thisComp.layer("Day and Night").transform.rotation/180*100

But, I need it to continue to work as the null rotates many many times...

Any suggestions?


Return to posts index

Dan Ebberts
Re: Convert rotation direction into a percentage?
on Nov 7, 2014 at 10:05:41 pm

It might be something like this:

r = thisComp.layer("Day and Night").transform.rotation;
linear(r%360,0,180,0,100)


Dan



Return to posts index

Sam Klejwa
Re: Convert rotation direction into a percentage?
on Nov 7, 2014 at 10:13:54 pm

Close, though then there's this sudden jerk when you go from 359 degrees to 360 (it fades up but doesnt fade down)


Return to posts index

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