Activity › Forums › Adobe After Effects Expressions › Display random frames without consecutive repetitions?
-
Display random frames without consecutive repetitions?
Posted by Danny Parsons on November 21, 2007 at 7:32 pmHi everyone,
This is the first time posting on any of the COW forums, although I
Danny Parsons replied 18 years, 5 months ago 3 Members · 8 Replies -
8 Replies
-
Dan Ebberts
November 21, 2007 at 9:18 pmThe basic idea would be something like this:
numFrames = 6;
seedRandom(index,true);
f = Math.floor(random(numFrames));
for (i = 0; i -
Dan Ebberts
November 22, 2007 at 4:54 pmSorry, the expression got trashed on it’s way to the page. Let me try it again. And yes, it’s for time remapping.
numFrames = 6;
seedRandom(index,true);
f = Math.floor(random(numFrames));
for (i = 0; i <= timeToFrames(time); i++){ f = (f + Math.floor(random(1,numFrames-1)))%numFrames; } framesToTime(f) Dan -
Danny Parsons
November 22, 2007 at 5:41 pmThanks! The repaired expression works a treat.
Unfortunately, however, a solution to the frame-rate issue still eludes me. Any suggestions?
Slightly off-subject, but relating to a potential back-up plan if I can
-
Mike Derk
December 5, 2007 at 8:24 pmWow, I was going to come on and ask just this exact question. And, by the way, I understand nothing in your expressions except the “modular function”.
So, here is my follow-on question: how would I alter the code if I wanted each individual drawing to play for 2 or 3 frames. For my purposes, playing only 1 frame is a bit fast.
Thanks,
Mike
-
Dan Ebberts
December 5, 2007 at 8:54 pmThis should do it:
numFrames = 6;
holdFrames = 3;seedRandom(index,true);
f = Math.floor(random(numFrames));
for (i = 0; i <= Math.floor(timeToFrames(time)/holdFrames); i++){ f = (f + Math.floor(random(1,numFrames-1)))%numFrames; } framesToTime(f) Dan -
Danny Parsons
December 7, 2007 at 1:45 amAnd I guess that more or less sorts out my frame-rate problem as well!
Whilst it would have been nice for any further animation added in the main comp to also be at the low frame-rate, I’m happy to choose this new expression over any of the relatively time-consuming makeshift ‘get-arounds’ I’ve come up with since conquering that initial hurdle (I’ve got a lot of scenes in this same style to get through).
So any ingenious suggestions that would achieve my ideal are still welcome!
For the meantime though: Thanks again, Dan, and thanks, Mike, for inadvertently pointing me towards a forehead-slappingly obvious solution!
Cheers,
DP
Reply to this Discussion! Login or Sign Up