Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Clock counter that starts with ’00’ instead of just ‘0’

  • Clock counter that starts with ’00’ instead of just ‘0’

    Posted by Joey Campbell on January 17, 2013 at 11:32 am

    Hi I’ve got a standard script that makes my text increase from 0 to 50 over 4 seconds….I’m trying to get it to count like this 00,01,02,03…instead of 1,2,3…..any ideas?

    startT = 0;
    endT = 4;
    beginVal = 0;
    endVal = 100;
    t = linear(time,startT,endT,beginVal,endVal);
    t.toFixed(0)

    Joey Campbell replied 13 years, 4 months ago 3 Members · 5 Replies
  • 5 Replies
  • Vishesh Arora

    January 17, 2013 at 12:36 pm

    joey

    Can’t say much about the Expression but I have a trick to work around using Numbers Effect.

    See the example:
    Increase_value_100.zip

    If this isn’t suitable, You would get an appropriate answer at Adobe After Effects Expressions Forum.

    Vishesh Arora
    3D and Motion Graphics Artist
    Films Rajendra

    Blog:
    https://digieffects.wordpress.com

    2011 3D Demo Reel:
    https://www.youtube.com/watch?v=lHPgIJU_BR8

  • Declan Smith

    January 17, 2013 at 12:45 pm

    Add this to your script; (i’m assuming this is on a text source property)

    s=””+t;
    while (s.length < 2) s=’0’+s;

    Declan Smith
    https://www.madpanic.tv
    After Effects CS5.5/ FCS3 / Canon 7D / Canon XL2 / Reason / Cubase

    “it’s either binary or it’s not”

  • Joey Campbell

    January 17, 2013 at 2:11 pm

    Hi Vishesh – I can’t open your file as I’m still using CS5 I’m afraid.

    Declan – thanks for the help – that change works initially for 00 but after that my counter starts using decimal places so it makes the change void. Is there anyway to get it not to use decimals (so it only goes up in 1’s) ?
    Joey

  • Declan Smith

    January 17, 2013 at 2:16 pm

    Yep.
    s=””+Math.floor(t);
    while (s.length < 2) s=’0’+s;

    Math.floor(t) will produce the lowest whole integer,
    Math.ceil(t) will produce the highest whole integer.

    Hope this helps

    Declan Smith
    https://www.madpanic.tv
    After Effects CS5.5/ FCS3 / Canon 7D / Canon XL2 / Reason / Cubase

    “it’s either binary or it’s not”

  • Joey Campbell

    January 17, 2013 at 2:28 pm

    Perfect – thanks for your help.

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