Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression for random stop, hold, continue

  • Expression for random stop, hold, continue

    Posted by Ace Billet on April 20, 2022 at 5:46 pm

    Trying to create an expression to wiggle a non-linear progress.
    Think a Photoshop “Save” progress bar filling (it pauses every once in a while, then goes again, then pauses, sometimes the progress is slower etc.)
    or ye olde Text Animator for Typewriter, where I want the typing to have some pauses and stops.
    Seems like this expression wiggles only one way as the progress only moves towards the 100%
    Ideally the frequency and duration of pauses will be able to be controlled by a slider if needed.

    Thank you!

    Ace Billet replied 4 years ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    April 20, 2022 at 9:55 pm

    Maybe some variation of this:

    minPeriod = 0.1;

    maxPeriod = 0.6;

    minVal = 0;

    maxVal = 10;

    accum = accumPrev = 0;

    t = tPrev = 0;

    seedRandom(index,true);

    while(t <= time){

    tPrev = t;

    accumPrev = accum;

    accum += random(minVal,maxVal);

    t += random(minPeriod,maxPeriod);

    }

    linear(time,tPrev,t,accumPrev,accum)

  • Ace Billet

    April 20, 2022 at 10:48 pm

    Thanks Dan, this works great for the typewriter effects when applied to the text animator.
    Trying to apply this to a linear wipe, but the wipe goes the opposite way (starts full all wipes down)

  • Dan Ebberts

    April 20, 2022 at 11:01 pm

    You probably just need to adjust a couple of lines:

    minPeriod = 0.1;

    maxPeriod = 0.6;

    minVal = 0;

    maxVal = 10;

    accum = accumPrev = 100;

    t = tPrev = 0;

    seedRandom(index,true);

    while(t <= time){

    tPrev = t;

    accumPrev = accum;

    accum -= random(minVal,maxVal);

    t += random(minPeriod,maxPeriod);

    }

    linear(time,tPrev,t,accumPrev,accum)

  • Ace Billet

    April 21, 2022 at 1:25 am

    Thank you thank you. This is perfect

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