FORUMS: list search recent posts

Linking rotation to comp time remap

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Al-Hakeem
Linking rotation to comp time remap
on May 10, 2013 at 5:45:23 pm

I've created a spinner game with 6 possible landing areas. As the arrow for the game spins, the landing area lights up, indicating which area the needle is over. So far I created a comp with an Arrow and a Pre-Comp with 6 frames, 1 frame for each landing area, and have been animating the light up area using time remap.

How would I write up an expression to use the Arrow's rotation to specify which time frame the Pre-Comp should be on?


Return to posts index


Dan Ebberts
Re: Linking rotation to comp time remap
on May 10, 2013 at 6:39:57 pm

Something like this should work:

r = thisComp.layer("Arrow").transform.rotation;
f = Math.floor((r%360)/60);
if (f < 0) f += 6;
framesToTime(f)


Dan



Return to posts index

Adam Al-Hakeem
Re: Linking rotation to comp time remap
on May 10, 2013 at 6:53:40 pm

Dan you the MAN!! One little problem, because of the way my board is setup my light up is happening 30° too late, or rather I'm 30° off.


Return to posts index


Adam Al-Hakeem
Re: Linking rotation to comp time remap
on May 10, 2013 at 8:00:09 pm

Oh... figured it out, just added 30 to r

r = thisComp.layer("Arrow").transform.rotation;
f = Math.floor(((r+30)%360)/60);
if (f &lt; 0) f += 6;
framesToTime(f)


Return to posts index

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