Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can this be done with expressions/scripting?!

  • Can this be done with expressions/scripting?!

    Posted by Paul Escandon on April 29, 2007 at 6:29 am

    Hello everyone.

    I am far from an expression afficionado – but I’m trying to learn.

    Anyhow – let me describe a little bit about what I”m trying to do. We have a new rodeo show that I am building graphics for and I made a timer that sits in the upper corner of the screen and counts up until the end of the run. The scores are generally in hundredths of second so scores can be anywhere from 4 to 17 seconds depending on the event, with hundredths of a second.

    The clock has to stop at the exact time that the event ends. When I used the Numbers effect on a solid layer and keyframed a range from 0 – 25 just letting it run up, as I’m sure all of you know the effect skips numbers since it’s trying to get through 100 numbers in the decimal spot in 30 frames.

    So not knowing anything about expressions or scripting, my solution was that I’ll render that movie that counts up to 25 skipping some hundreths of a second each frame, and then I’ll render out a seperate movie at 99 frames per second doing the same thing – on this movie, every different number in the hundredth of a second decimal places was rendered out correctly. So now what an editor would have to do working on a show is use the first movie of the clock counting up at 29.97 frames per second, then stop that movie at the point where the next frame would be more than the actual score of the rider. Then they would open the 99 frames per second movie and find the exact frame that corresponds to their actual time, make that a freeze frame and then drop it in at the very next frame. This has, definitely solved the problem…

    and now to my question…

    Is there a way that this could be done easier? In after effects, the whole thing was taking a long time to render, I am working in HD and the first render was using the Zaxwerks Invigorator 3D plugin for the clock… however on the most recent pass I just have the numbers for the clock totally isolated on a seperate layer, just the text with a drop shadow… so what I was looking for is some way to tell after effects to specifically keyframe the timer to go from 0 to whatever the final score is at 29.97 FPS, more preferably would be if I could stick ALL the scores i’m going to need fir a specific episode in a single text file or something that AE can read, and have it do a batch render one after another.

    I know I’ve written a lot, but I need to start using Creative Cow and the expertise on here more to help me figure out things I don’t understand.

    Thanks for taking the time!

    P. Escandon
    Outdoor Channel
    Editor / Motion Graphics

    Dan Ebberts replied 19 years ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    April 29, 2007 at 6:57 am

    You could apply an expression like this to a text layer:

    maxTime = 7.37;
    Math.min(time,maxTime).toFixed(2);

    You’ll have to adjust maxTime for each event. You could automate the entire process with a script that would read a text file, but that’s a little more complicated.

    Dan

  • Julian Sixx

    April 29, 2007 at 7:03 pm

    Hi

    Dan,would you mind explaining the “to fixed” function .
    The above expression also works without this function.
    THX

  • Dan Ebberts

    April 29, 2007 at 7:29 pm

    toFixed(n) just rounds a number off to n decimal places.

    Dan

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