Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Counter parented to slider with rotation that changes place values accurately?

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

    Posted by Dylan Wilbur on June 5, 2019 at 11:55 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.

    Dylan Wilbur replied 7 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy