Countdown Timer Script

Scripting for After Effects

Re: Countdown Timer Script

Postby Sinan Karacam on 01/7/2012, 7:20 am

Thx for sharing it with us.
Sinan Karacam
 
Posts: 19
Joined: 11/10/2011, 10:16 am
Location: Istanbul/ Turkey

Re: Countdown Timer Script

Postby lrntbb2 on 12/17/2016, 4:16 am

You can use this free tutorial on vdodna's site:

http://www.vdodna.com/tutorials/3-digital-clock/


Or use this Digital Clock / Timer Presets:

http://www.vdodna.com/products/digital- ... r-presets/


Good Luck!

Image
lrntbb2
 
Posts: 4
Joined: 06/3/2016, 2:58 am
System Specs: i7
32 gigs
gtx 770

Re: Countdown Timer Script

Postby Guitarboy2828 on 12/17/2016, 6:39 am

After effects has a limit of a 3 hour composition, so, even though you can create an expression that'll create Days, hours, minutes, seconds, you won't be able to create a long enough video. Besides a video that is 72 hours long is going to be HUGE and most computers will struggle to play it, even if it is just a countdown clock.

Anywas, that being said, this script should do what you're after.

Code: Select all
countspeed = 1;
clockStart = 0;

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

clockTime = clockStart +countspeed*(time - inPoint);

if (clockTime < 0){
  minus = "-";
  clockTime = -clockTime;
}else{
  minus = "";
}

t = Math.floor(clockTime);
d = Math.floor(t/86400);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(d) + ":" + times(h) + ":" + times(min) + ":" + times(sec)
Guitarboy2828
 
Posts: 357
Joined: 04/1/2012, 12:05 pm

Previous

Return to After Effects Expressions