Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random Time/Frame

  • Posted by Jeremy Wick on May 21, 2012 at 4:49 pm

    I created some .mov files in Photoshop, at 12 fps, using a basic rotoscoping technique. I like the wiggly effect, but to save time, I only animated 1 second of each asset and I am planning on looping these in After Effects with the loopOut expression.

    To make it look less like it is repeating every second, I am trying to figure out an easy way to randomly generate the time on each frame.

    For example: new frame 1 = original frame 3, new frame 2 = original frame 9, new frame 3 = original 1 …and so on.

    I would use random() but I want to avoid having the same frame twice in a row because it makes it look choppy.

    Dan Ebberts replied 13 years, 12 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    May 22, 2012 at 1:09 am

    I think this will guarantee you don’t get the same frame twice in a row:


    numFrames = 90;
    seedRandom(index,true);
    f = timeToFrames(time);

    fr = Math.floor(random(numFrames));
    for ( i = 1; i <= f; i++)
    fr = (fr + Math.floor(random(1,numFrames)))%numFrames;
    framesToTime(fr)

    Dan

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