-
Randomise frames without repetition
Hi there all. I hope you are well.
I would like to randomise frames of a precomp without repeating them. Just give them a shuffle.
I found this expression on a previous post courtesy of Dan Ebberts, but it doesn’t seem to work when I plug it into the timeRemap. The problem is with line 9. I flipped the bracket but then it threw up and error about an illegal use of a reserved word at line 12.
I am not familiar with the for(i… etc) bit of the expression to know what is going wrong.
Could some kind soul please give me a hand
Thanks in advancePeter
n = 100; // number of images
minDur = 25;
maxDur = 40;seedRandom(index,true);
images = [];for(i = 0; i < n; i++){
images[i] = i;
}for (i = 0; i < n; i++){
idx = i + Math.floor(random(images.length - i));
temp = images[i];
images[i] = images[idx];
images[idx] = temp;
}dur = 0;
f = -1;
while (time >= dur*thisComp.frameDuration && f < images.length - 1){
f++;
dur += Math.floor(random(minDur,maxDur+1));
}
images[f]*thisComp.frameDuration