Activity › Forums › Adobe After Effects Expressions › Rotation counter
-
Rotation counter
Posted by Frank Johnson on February 9, 2019 at 1:23 amIt seems simple with expressions but I haven’t been able to get it to work. I need the number text to change with every rotation.
The counter reads “0.000” at the start but when the item rotates 5 times over 10 seconds the counter reads “5.000”
Thank you
Frank Johnson replied 7 years, 6 months ago 4 Members · 9 Replies -
9 Replies
-
Andrei Popa
February 9, 2019 at 7:37 amIn the “Source Text” property write this expression:
rot=thisComp.layer("Shape Layer 1")("Transform")("Rotation");//here you can pickwhip the rotation property of the layer you need to count
Math.floor(rot/360)Andrei
My Envato portfolio. -
Frank Johnson
February 9, 2019 at 8:59 pm -
Dan Ebberts
February 9, 2019 at 10:11 pmYour expression needs to look like this:
rot=thisComp.layer(“FW3.tif”)(“Transform”)(“Rotation”);
Math.floor(rot/360)Dan
-
Frank Johnson
February 10, 2019 at 12:05 amThank you that helped but I dont understand what happened.
Nothing worked until i turned off the Numbers effect in the Effect Controls Panel.The red numbers went away but some new white one appeared. They are counting but, since I turned off the effect, I have no control over how it’s displayed. There are way too many digits and the decimal is in the wrong place.
I don’t know why it appeared after I turned of the Numbers effect in the effects panel?
THANKS!!!!
-
Dan Ebberts
February 10, 2019 at 12:29 amI’m confused. Are you using the source text of a text layer to display the rotation count, or the Number effect?
Dan
-
Tomas Bumbulevičius
February 10, 2019 at 6:40 pmFrank,
the Numbers effect ignores any layer’s source visuals and generates numbers solely rendered by this effect.
However, by adding the expression provided by Dan into text’s source property, you will get the numbers accordingly. Their visuals can be adjusted through the Character panel. If you need some more customisation of numbers like trailing zeroes, etc – just let us know your specification in detail.
Find out more:
After Effects Tutorials: motion design, expressions, scripting. -
Frank Johnson
February 12, 2019 at 11:25 pm -
Tomas Bumbulevičius
February 13, 2019 at 1:10 pmTo have decimals, you don’t need to ‘floor’ the result. In general, it would be:
num = 5.567;
parseFloat(num).toFixed(2);Result would be: 5.57
In your expression as below:
rot=thisComp.layer("FW3.tif")("Transform")("Rotation");
parseFloat(rot/360).toFixed(2);Find out more:
After Effects Tutorials: motion design, expressions, scripting. -
Frank Johnson
February 14, 2019 at 4:20 amAmazing!
This is for a museum so you’ve made the world a better place…
Seriously, much thanksFrank
Reply to this Discussion! Login or Sign Up


