FORUMS: list search recent posts

# Convert rotation direction into a percentage?

FAQ   •   VIEW ALL
 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?

 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