Activity › Forums › Adobe After Effects Expressions › Footage Loops that don’t repeat exactly
-
Footage Loops that don’t repeat exactly
Posted by Sasha Zelman on September 1, 2013 at 7:51 pmIs there a way to loop short composition, that was previously Time Remaped to produce random frames, in such a manner so random seeds change between the loops and produce new random loops?
Sasha Zelman replied 12 years, 8 months ago 2 Members · 6 Replies -
6 Replies
-
Darby Edelen
September 1, 2013 at 9:21 pm[Sasha Zelman] “Is there a way to loop short composition, that was previously Time Remaped to produce random frames, in such a manner so random seeds change between the loops and produce new random loops?”
I can’t think of a way off the top of my head.
If you’re randomizing something that’s already random though, wouldn’t the results just be… random? To put that another way: why do you need to loop at all? Why not just generate random numbers?
Perhaps there’s another way to achieve the result you want. What is the goal?
Darby Edelen
-
Sasha Zelman
September 2, 2013 at 8:18 pmAdditional randomization will generate MORE frames. Let’s say our random sequence is only 10 frames long. If we cycle it we will get repetition of the SAME frames. If we could cycle AND reset the seed we would get MORE random frames. Of course it is possible to just make original sequence longer… but that may not be convenient if you deal with multiple random sequences of preset length that you want to combine in a larger comp.
I may be missing something obvious of course, since my knowledge of AE is quite superficial…
-
Darby Edelen
September 5, 2013 at 6:04 amI think I’m not understanding the final goal. If your sequence (pre-comp?) is 10 frames long then you’ll always only have 10 frames to randomly select from. If you enable time remapping and randomly select a new frame on every frame then you’d get exactly that: a frame chosen from the set of 10 total frames on every frame of the comp.
The way I understood your initial question was that you have a set of random frames, you want them to loop but have a new randomized set on every loop. Imagine there are 5 frames, we’ll letter them A-E, then your current random sequence could be:
DADBA
Now you want to generate a new set of random frames for the next loop and we get:
ABEDD
So your two loops together read DADBAABEDD. Couldn’t that be generated just by selecting a new random frame at every frame?
I’ve probably misunderstood the premise and your goal, but I need clarification to understand it. Are you hoping to generate random non-repeating sequences? For example:
DAEBC
AEDCB
Where each frame occurs only once? If possible share your current expression and how you’d like its behavior to change.
Darby Edelen
-
Sasha Zelman
September 5, 2013 at 9:08 pmI suspect that some very simple thing eludes my grasp, but I will try to explain myself better.
My goal is to work with a precomp of fixed length placed in longer comp and generate the longer random sequences than short comp allows.
For example: currently my 5 frame precomp generates AEDC-, and if placed in 20 frame comp the result is going to be AEDC-AEDC-AEDC-AEDC- but I need to squeeze more randomness out of 5 frame precomp.You reply “Couldn’t that be generated just by selecting a new random frame at every frame?”
My understanding that new random frame at precomp level will generate just another 5-frame repeating sequence. So in a way my question is can precomp be changed in real time while longer comp is progressing through time?
It appears that you have already answered that question negatively by: “If your sequence (pre-comp?) is 10 frames long then you’ll always only have 10 frames to randomly select from”…
Sorry for the trouble.
PS.
Anyway the idea that you have mentioned (every random frame is repeated only once) is pretty cool… is there an expression for that?
-
Darby Edelen
September 6, 2013 at 2:57 amInstead of generating the random frames in the 5 frame comp, or in addition to that, apply time remapping to the pre-comp in the parent composition and apply another random() function there. Something to the effect of:
source = thisLayer.source;
d = source.frameDuration;
frames = source.duration / d;
random(0, frames) * d;This will first find the duration of the source (the pre-comp) which in our example is 5 frames. Then it will randomly generate a number between 0 and 5 on every frame of the composition. This will occur across the entire duration of the parent composition. So you’d get a random frame from your 5 frame set on every frame.
Darby Edelen
-
Sasha Zelman
September 6, 2013 at 9:41 pmThank you for all your help, Darby. It makes perfect sense now… My thinking was too convoluted not to see this solution…
Sasha
Reply to this Discussion! Login or Sign Up