Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create a counter for stills

  • Create a counter for stills

    Posted by Adriano Moraes on September 14, 2009 at 10:52 pm

    Hi there!

    I need to add a simple counter over a slideshow so I can send it to my client and they can reorder things or make changes without driving me completly nuts.

    There are 104 stills all with the same duration (10 secs each). The last pic enters at 1139 secs.(the comp has 1149secs)

    I visited Dan Ebbert´s site and after playing with numbers I came up with this and applyed to the Source of a text layer:

    //start code

    numDecimals = 0;
    beginCount = 1;
    endCount = 104;
    dur = 1139;

    t = time – inPoint;
    s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

    //end code

    It kind of works but it´s not actually counting right. The numbers come up too late. i.e. #2 is displayed only after pic#2 is up for a while. (and it gets in later and later as it progresses.)

    I´m still trying here but I wonder if someone would give me a hand.

    Hope I made myself clear enough. I allready looked around the forum for old posts. Most helped but I couldn’t find the real one answer.

    Ok enough of that. Off to work .

    Thanx in advance.

    Cheers.

    adriano moraes

    Adriano Moraes replied 16 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 14, 2009 at 11:23 pm

    Your math seems a little suspicious (104 layers in 1149 sec is 11.048 per), but in any case, if they’re all the same duration, something like this should work:

    stillDuration = 10;
    Math.floor(time/stillDuration) + 1;

    Dan

  • Adriano Moraes

    September 14, 2009 at 11:31 pm

    Thank you very much Dan!

    Not only you solved my problem but you actually opened my eyes. It was not suspicious it was all wrong!!! I forgot about the extra seconds I added so the fades would not take time from the pics. And I´m using a rendered video so I could not see the overlays and conect the dots in my mind.

    I got so much into solving the puzzle that I actually was putting it togheter with the pieces facing down.

    Thanks for the fast response and the short new expression.

    Cheers.

    adriano moraes.

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