Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to randomize time remap frame and hold for random time

  • Expression to randomize time remap frame and hold for random time

    Posted by Marc Thomas on November 3, 2011 at 8:13 pm

    Hi everyone,
    I’ve been looking through posts and have had a very difficult time finding a script that both randomizes a time remap frame from a 5 frame precomp, AND can hold the still frame for a random (15 60 frames).

    What I’m trying to do is sort of replicate the look of Christmas lights blinking in different colors, where dots are spelling out a word and are supposed to blink in 1 of 5 different colors, so holding for a moment, then changing to a different color. I don’t all the “lights” to change at the same time, say .5 seconds, and it’s waaay too fast if the colors are only up for 1 frame.
    Also if anyone can suggest a script for having each dot appear on screen in random order and then holding for the duration of the comp, that would also be a HUGE help. I’m working with upwards of 75 Layers, so doing this manually is inefficient.
    Any help is greatly appreciated.

    Thanks,
    Marc

    Marc Thomas replied 14 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 4, 2011 at 3:47 am

    I think this works:


    numFrames = 5;
    minDur = 15;
    maxDur = 60;

    f = timeToFrames();
    f0 = 0;
    seedRandom(index,true);
    while (f0 <= f){
    f0 += Math.floor(random(minDur,maxDur+1));
    }
    seedRandom(f0,true);
    framesToTime(Math.floor(random(numFrames)));

    Dan

  • Marc Thomas

    November 4, 2011 at 12:49 pm

    Thanks Dan!
    This seems to be working great! Any thoughts on making the 75 Layers pop up in random order in under 2 (or an adjustable number of) seconds?
    Cheers,
    Marc

    MarcRocks!

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