Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Playing (and Replaying) A Precomp At Specified Timestamps

  • Playing (and Replaying) A Precomp At Specified Timestamps

    Posted by Pierce Culver on August 11, 2024 at 5:14 pm

    Hey there, folks!

    I’m working on a dynamically updating typewriter animation, and my (lack of) skill with expressions has put me in something of a pickle.

    Basically, I have an invisible layer that serves to create and maintain an array. Said array includes letters to be “typed” and timestamps for when that “typing” should happen. A visible layer (comprising only text) parses that array and reveals said letters at their associated times. That part works more or less perfectly.

    What I’d like to do is have a third layer play a three-frame-long animation at each associated timestamp (with one caveat). For example, if the entries in my array are as follows…

    T / 0.14
    h / 0.24
    i / 0.35
    s / 0.45
    / 0.53
    i / 0.64
    s / 0.76
    / 0.95
    i / 1.05
    t / 1.12

    … then the aforementioned animation should play at 0.14, 0.24, 0.35, and so on.

    The caveat is that I’d like a different animation to play if the associated character is a space. Once I’ve managed to get the primary animation to work, that shouldn’t be too difficult… but that primary animation is what’s giving me trouble at the moment.

    Said animation – which is precomposed – is really just three frames and an audio file followed by a still image (which is in place to ensure that an “at rest” look is achieved), so it can replay from its starting frame whenever necessary. The issue is actually getting it to do that.

    Any insight would be very much appreciated!

    (Also, if there’s a better way to achieve the intended result, I’m not averse to starting from scratch!)

    Pierce Culver replied 1 year, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 11, 2024 at 8:59 pm

    My guess is it would look something like this:

    txt = thisComp.layer("times").text.sourceText;
    splt = txt.split("\r");
    n = splt.length;
    t = 0; i = n-1;
    function getTime(x){return(parseFloat(splt[x].split("/")[1]))}
    while(i >= 0){
    if (time >= getTime(i)){
    t = time - getTime(i)
    break;
    }
    i--;
    }
    valueAtTime(t);
  • Pierce Culver

    August 12, 2024 at 4:45 pm

    Thank you, Dan!

    I still have a bit of tinkering to do, but that’s given me everything that I needed to start making some actual progress again.

    This whole experience has been an inspiration, too:

    https://www.youtube.com/shorts/5KoNofFJfwc

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

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