Copy link to clipboard
Copied
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)
Like this:
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.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.