Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Count-Up Timer Configuration Tutorial

Community Beginner ,
Aug 10, 2024 Aug 10, 2024

The YT link below shows a Count-Up Timer tutorial I hope somebody in this forum can expand on because what I need to do is not covered in the tutuorial:

 

https://www.youtube.com/watch?v=FhDK12uvOBM 

 

I need the timer to start at 1hour:30minutes:00seconds and then count-up to 1hour:37minutes:00seconds. What is the correct slider, keyframe, composition and/or expression edits needed so the clock counts up 7minutes and comes to a stop at 1hour:37minutes:00seconds? I hope somebody can give me some advice because I cannot make such a countup animation work correctly.

 

Below is the timer expression I am using just in case it needs to be modified to make this animation work as I described:

 

slider = Math.round(effect("Slider Control")("Slider"))

sec = slider%60
x = Math.floor(slider/60)

min= x%60

hour = Math.floor(slider/3600)

function addZero(n){ if (n<10) return "0" + n else return n }

addZero(hour) + ":" + addZero(min) + ":" + addZero(sec)

 

TOPICS
Error or problem , Expressions
2.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Advocate , Aug 10, 2024 Aug 10, 2024

Like this:

Translate
Advocate , Aug 10, 2024 Aug 10, 2024

Don't forget to extend your text layer duration until the end of the composition.

And set your composition duration to 7 minutes, not 7 seconds.

screenshot.pngexpand image

Translate
Advocate ,
Aug 10, 2024 Aug 10, 2024

1/ Create a text layer and enter 01:30:00, the count-up will start from this value

2/ add a slider control, set the value to 7*60 (for 7 minutes)

3/ then add this expression

 

seconds = effect("Slider Control")(1);
val = value.split(':');
timeToCurrentFormat(Math.floor(Number(val[0]) * 3600 + Number(val[1]) * 60 + Number(val[2]) + Math.min(time, seconds))).slice(0, -3)

 

screenshot.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 10, 2024 Aug 10, 2024

Airweb_AE,

Thank you for your post. I am a beginner After Affects user so please excuse my newbie questions.  I have attached a screenshot of what I am looking at in my AE GUI.  Below I summarize your three steps from my POV:

 

Step 1:  May you please elaborate where the 01:30:00 value gets entered? It is not clear to me if you mean enter it in the "Start Timecode" (D) field or the "Duration" (E) field in the Composition Setting window.

Step 2:  No problem here because I followed the steps shown in the video.

Step 3: Just to confirm. Your expression 100% replaces the old expression I was using. Correct?

 

The problem I am experiencing is the Slider Control does not dynamically change the RED minute numbers when I drag my mouse over the "420" slider control value. I think it may have something to do with how the areas I have circled in RED denoted as (A), (B) and (C) do not match the screenshot you posted.  

 

May you please provide some insight on what configuration changes I need to make so that my (A), (B) and (C) values match the ones you have.  Thank you for your time.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 10, 2024 Aug 10, 2024

Like this:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 10, 2024 Aug 10, 2024

Don't forget to extend your text layer duration until the end of the composition.

And set your composition duration to 7 minutes, not 7 seconds.

screenshot.pngexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 13, 2024 Aug 13, 2024

Thank you Airweb for uploading a working AFX file. I really appreciate it because it enabled me to figure out the correct configuration by duplicating it in a new AFX file of my own. Interesting to learn the original expression I was using had to be tossed out.  And just for kicks I timed the AFX seven minute animation against my kitchen cooking timer and both match perfectly.  Again, thank you very much for your help in making this count-up timer animation work correctly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 02, 2024 Dec 02, 2024
LATEST

 

To configure the Count-Up Timer to start at 1 hour 30 minutes and counting tools up to 1 hour 37 minutes in After Effects, you need to adjust your expression and keyframes as follows:

  1. Start Time Adjustment: Set your Slider Control value to 5400 (for 1 hour 30 minutes) at the starting keyframe.

  2. End Time Adjustment: Set the Slider Control to 5520 (for 1 hour 37 minutes) at the ending keyframe.

  3. Expression Edit: Your existing expression seems correct, but ensure the slider value smoothly interpolates between 5400 and 5520 over time. Here's a modified version of your expression:

 

javascript
slider = Math.round(effect("Slider Control")("Slider")) sec = slider % 60 x = Math.floor(slider / 60) min = x % 60 hour = Math.floor(slider / 3600) function addZero(n) { if (n < 10) return "0" + n return n } addZero(hour) + ":" + addZero(min) + ":" + addZero(sec)
 
  1. Keyframes: Apply keyframes to the Slider Control, starting at 5400 at the beginning and 5520 at the end (after 7 minutes).

This should allow the timer to count up from 1 hour 30 minutes to 1 hour 37 minutes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines