-
Expression to switch to the next frame in a sequence at a random time
I need an expression that will advance to the next frame in a sequence at a random time. I would like to give the expression the start frame and a min/max number of frames to hold. So something like this:
startFrame = 12;
minFrames = 100;
maxFrames = 150;
So sometime between frame 100-150 it will advance to the next frame, 13. I’ve been trying the following script which was based on one of Dan Ebberts’ for picking a random frame, but I have not got it to work for just advancing to the next frame at a random time without a stroboscopic effect happening.
nFrames = 5;
dur = .5;
seedRandom(index,true);
n = Math.floor(random(nFrames));
for (i = 0; i <= time; i += dur){
seedRandom(i,true);
n ++;
}
framesToTime(n);