Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Countdown with static character space

  • Countdown with static character space

    Posted by Chris Tompkins on August 26, 2012 at 7:45 pm

    Not one for expressions.

    But I’m trying to have a count down in Minutes and seconds.

    Found a “Effects & Presets” called Clockworks.

    Has a lot of control, does all I need. Except, that the numbers shift back and forth a bit. Center or Left or Right justify is no help.
    Is there a way to lock em still?
    I tried adding Animate, Character offset, adjust kerning. No help.
    See sample here:

    Clockworks

    if(effect("Clockworks")("Countdown") == 1){OT = time*-1;}else{OT = time;}
    if(effect("Clockworks")("Countdown") == 1){IP = (thisLayer.inPoint*effect("Clockworks")("Speed")/100) ;}else{IP = (thisLayer.inPoint*effect("Clockworks")("Speed")/100)*-1}
    Tr = (OT*effect("Clockworks")("Speed")/100) +effect("Clockworks")("Add Hours")*3600 +effect("Clockworks")("Add Minutes")*60 +effect("Clockworks")("Add Seconds") +effect("Clockworks")("Add MilliSeconds")/100 + IP*effect("Clockworks")("Start At Layer");
    if(Tr < 0 && effect("Clockworks")("Stop At 0") == 0){T =(Tr*-1)+effect("Clockworks")("Skip sec -0");}else{T=Tr}

    H = Math.floor(T/3600);
    M = Math.floor(T/60);
    S = Math.floor(T) ;
    MS = Math.floor(T*100);

    MF = M-H*60;
    SF = S-M*60;
    MSF = MS-S*100;

    if(H<10 & effect("Clockworks")("Always 2 Digits") == 1){HZ = "0";}else{HZ = "";}
    if(MF<10 & effect("Clockworks")("Always 2 Digits") == 1 || H < 0 & effect("Clockworks")("Always 2 Digits") == 1){MZ = "0";}else{MZ = "";}
    if(SF<10 & effect("Clockworks")("Always 2 Digits") == 1 || H < 0 & effect("Clockworks")("Always 2 Digits") == 1){SZ = "0";}else{SZ = "";}
    if(MSF<10 & effect("Clockworks")("Always 2 Digits") == 1 || H < 0 & effect("Clockworks")("Always 2 Digits") == 1){MSZ = "0";}else{MSZ = "";}

    if(Tr<0 & effect("Clockworks")("Countdown") == 1 || Tr>0 & effect("Clockworks")("Countdown") ==0 ){FLT = Math.round(linear(T % 1,0,1));}else{FLT = Math.round(linear((T-.5) % 1,0,1));}
    if(effect("Clockworks")("Use '; '") == 1){SPo = "; ";}else{SPo = ":";}
    if(effect("Clockworks")("Use '; ' at Milli Sec.") == 1){MsSPo = "; ";}else{MsSPo = ":";}
    if(effect("Clockworks")("Use '; '") == 1){SPDs = " ";}else{SPDs = " ";}
    if(effect("Clockworks")("Use '; ' at Milli Sec.") == 1){MsSPDs = " ";}else{MsSPDs = " ";}
    if(effect("Clockworks")("Flicker (Monospaced)") == 1 && FLT == 0){SP = SPo;}if(effect("Clockworks")("Flicker (Monospaced)") == 1 && FLT == 1){SP = SPDs;}else{SP = SPo;}
    if(effect("Clockworks")("Flicker (Monospaced)") == 1 && FLT == 0){MsSP =MsSPo;}if(effect("Clockworks")("Flicker (Monospaced)") == 1 && FLT == 1){MsSP = MsSPDs}else{MsSP = MsSPo;}

    if(effect("Clockworks")("End With Point") == 1){Pt = ".";}else{Pt = "";}
    if(Tr < 0 && effect("Clockworks")("Stop At 0") == 0){NT = "-";}else{NT = "";}

    if(H < 0){P = 0;}else{P = 1;}
    if(effect("Clockworks")("Show Hours") == 1){Hours = HZ + H*P;}else{Hours = "";}
    if(effect("Clockworks")("Show Minutes") == 1){Minutes = MZ + MF*P;}else{Minutes = "";}
    if(effect("Clockworks")("Show Seconds") == 1){Seconds = SZ + SF*P;}else{Seconds = "";}
    if(effect("Clockworks")("Show MilliSeconds") == 1){MilliSeconds = MSZ + MSF*P;}else{MilliSeconds = "";}

    if(effect("Clockworks")("Show Hours") == 1 & effect("Clockworks")("Show Minutes") + effect("Clockworks")("Show Seconds")>0){HM = SP;}else{HM = "";}
    if(effect("Clockworks")("Show Minutes") == 1 & effect("Clockworks")("Show Seconds") == 1){MS = SP;}else{MS = "";}
    if(effect("Clockworks")("Show MilliSeconds") == 1 & effect("Clockworks")("Show Hours") + effect("Clockworks")("Show Minutes") + effect("Clockworks")("Show Seconds") > 0){SMS = MsSP;}else{SMS = "";}

    NT + Hours + HM + Minutes + MS + Seconds + SMS + MilliSeconds + Pt

    Chris Tompkins
    Video Atlanta LLC

    Chris Tompkins replied 13 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 26, 2012 at 9:00 pm

    I think you need to switch to a mono-spaced font. I’m surprised that a 7-sgement font wouldn’t already be set up that way.

    Dan

  • Chris Tompkins

    August 26, 2012 at 9:07 pm

    Thanks, ended up going back the the numbers effect.
    Time Code.
    Then sub comp.
    Then mask out the hours and the frames.
    Leaving just minutes and seconds like we needed.
    Right justify’d.

    Chris Tompkins
    Video Atlanta LLC

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