ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Counter parented to slider with rotation that changes place values accurately?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dylan Wilbur
Counter parented to slider with rotation that changes place values accurately?
on Jun 5, 2019 at 11:55:10 pm

The setup:
I have 10 number layers (0-9), parented to a 3D null but offset so that each number is 36 degrees away from the next one in z space. (The null is 1500 pixels back in z-space, if that matters). Rotating the x-axis of the null 360 degrees cycles through all the numbers once so that you start and arrive back at 0, and each number is sized and positioned so that only 1 number is in frame at at time (though when another number is animating in, you can see it enter or exit the frame). I have a black solid at the same position as the null to obscure the numbers when they would be in frame on the back half of their rotation. That layer is precomped as "Number Counter - Ones". I then duplicate that layer in the project panel, and name that "Number Counter - Tens" and so on, up to the hundred thousands place. All those precomps have Unmult applied so they get back their transparency.

I then have the rotation controller null in each one of these precomps looking at a null in the main comp with a corresponding slider named for whatever place value it is (ones, tens, hundreds, etc). Those sliders have expressions looking at a final master slider*36, depending on the place value, like so:

Ones
effect("Number Controller")("Slider")*36
Tens
effect("Number Controller")("Slider")*3.6
Hundreds
effect("Number Controller")("Slider")*.36

and so on.

This works almost fine. I can animate the "Number Controller" slider and the numbers will count up accurately (and more importantly, do so with a transform animation, rather than a source text animation).

The Problem:
Unfortunately, each place value is constantly moving towards it's next value, rather than holding position and then animating smoothly when the preceding value goes from "9" to "10" (0). For instance, if I animate the slider from 0 to 125, the hundreds place will slowly move from 0 to 1 over the duration of those two key frames, and the at the end the tens place will be halfway between the 2 and the 3.

Anyone have any thoughts on how I can math this so that it animates smoothly to the next value only when the preceding place value goes from "9" to "0"? Also, my set-up seems fairly convoluted, so if you have ideas on how to streamline this, or build it in a smarter way, I'm all ears.


Return to posts index

Kalleheikki Kannisto
Re: Counter parented to slider with rotation that changes place values accurately?
on Jun 8, 2019 at 8:20:39 am

I think you'll find this of interest:

https://reels.creativecow.net/film/advanced-odometer-demo

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Dylan Wilbur
Re: Counter parented to slider with rotation that changes place values accurately?
on Jun 10, 2019 at 5:43:06 pm

Ah! Of course, I should have thought to search for "odometer" instead of counter, thanks for you help!


Return to posts index

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