ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking rotational value correctly to a compass graphic

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Scott Green
Linking rotational value correctly to a compass graphic
on Dec 2, 2019 at 12:45:48 pm
Last Edited By Scott Green on Dec 2, 2019 at 12:47:24 pm

I've been racking my brains trying to figure out how to correctly link a number value to a rotating compass graphic (using a basic wiggle) so that the values are between 0° and 360° (or 359° and then it changes to 0 if it's 360°) rather than using minus values.

Can anyone help?



21° is correct.



-30° is incorrect - this should be 330°.



Project file:
13937_compass.aep.zip

-thisComp.layer("Dial").transform.rotation[0].toFixed(0)+"°"


Return to posts index

Dan Ebberts
Re: Linking rotational value correctly to a compass graphic
on Dec 2, 2019 at 4:01:17 pm

You could change your rotation wiggle() expression to:

w = wiggle(0.2,60);
if (w < 0) w += 360;
w

and remove the "-" from your text expression.

Dan



Return to posts index

Scott Green
Re: Linking rotational value correctly to a compass graphic
on Dec 10, 2019 at 7:51:56 am

Sorry for the late reply Dan, the notification ended up in my spam folder.

Thanks for the info, but I'm not quite getting the result I was hoping for.

I think that the solution might be to try and link the Source Text property to the 2nd value of the Rotation Property, but to ignore the "1x" value and the "-" value.

For example...


...ignore "0x" and ignore "-" to give 15°.


...ignore "0x" and ignore "-" to give 359°.



...ignore "-1x" to give .


...ignore "-1x" to give 30°.

Does that make more sense?
Would that be possible?

The wiggle was used just to test it out. I'll probably be keyframing these values manually but with a bit of wiggle added.

Many thanks.


Return to posts index


Dan Ebberts
Re: Linking rotational value correctly to a compass graphic
on Dec 10, 2019 at 8:01:26 am

Maybe like this then:

w = wiggle(0.2,60);
w %= 360;
w += (w < 0) ? 360 : 0;


Dan



Return to posts index

Scott Green
Re: Linking rotational value correctly to a compass graphic
on Dec 10, 2019 at 8:06:39 am

Sorry, that doesn't work either.



Motion Videos UK - We are creative video designers who bring pleasure, meaning and beauty to our small world through film, motion graphics and animation.


Return to posts index

Dan Ebberts
Re: Linking rotational value correctly to a compass graphic
on Dec 10, 2019 at 5:01:43 pm

I think you just need to get rid of the "-" operator at the beginning of your text expression.

Dan



Return to posts index

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