ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Play composition randomly using a selection of user-defined frame ranges?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Freddie Horton
Play composition randomly using a selection of user-defined frame ranges?
on Jan 27, 2014 at 8:50:56 pm

Hi,

I have about 20 layers of the same composition, and I want each one to play a random frame range that I can define, so for example, 0-100 101-200, 201-300, 301-400 etc.

I would also like to know how to make the composition stop playing after the randomly selected frame range has been played out.

I thought I would be able to find a solution online but so far nothing that I can make sense of, if someone could help me out that would be fantastic. I hope this makes sense!

Thank you very much!


Return to posts index

Stuart Paciej
Re: Play composition randomly using a selection of user-defined frame ranges?
on Jan 27, 2014 at 11:12:18 pm

I'm not sure I fully understand what you're after.

You want the layer containg the pre-composition to stop playing whilst the rest of your master composition continues?

I think you want the time remap feature. This allows you to keyframe start and and end frames, also allows you to change the speed.

So you could time-remap your layer alt+cmd+t / ctrl+alt+t
Then pick frame 0 (there will be a key frame here by default) and then put another keyframe on frame 100.
Then go to the end of the composition and delete the last keyframe. Now your composition will only play those 101 frames and then freeze.

If you want to loop these sections you can use the loopOut expression (look on Dan Ebbert's site for expressions advice and instructions on how to implement it).

Hope that helps

S


Return to posts index

Dave LaRonde
Re: Play composition randomly using a selection of user-defined frame ranges?
on Jan 28, 2014 at 12:29:20 am

AE isn't interactive in the way it sounds like you think it should be. You need to plan out what you want to do, make it that way, and then render it out for playback on some other device.

So the interactivity would be in that other playback device. I guess that's what you're after.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index


Freddie Horton
Re: Play composition randomly using a selection of user-defined frame ranges?
on Jan 28, 2014 at 11:04:30 am

Thank you both for the replies,

I am not sure what you mean about it being interactive, though, that is not what I'm after. The script I am after is just to save me having to manually change the input and output time for each and every composition.

Say you have 100 layers of the same pre-composition, and you just want a script that randomly chooses a frame within each one to play from, so that they all start from a different point in time within themselves. Surely there must be a way to do that?

Sorry If it wasn't clear!


Return to posts index

Walter Soyka
Re: Play composition randomly using a selection of user-defined frame ranges?
on Jan 28, 2014 at 2:32:33 pm

[Freddie Horton] "Say you have 100 layers of the same pre-composition, and you just want a script that randomly chooses a frame within each one to play from, so that they all start from a different point in time within themselves. Surely there must be a way to do that?"

Enable time-remapping for the layer, then alt-click its stopwatch to enter the following expression:

seedRandom(index,true);
timeOffset = random(min, max)
time+timeOffset;


This expression picks a random time offset within a range and adds that to the current time in the main comp to pick a random starting point for the layer.

You will need to replace min and max with your own values. Together, they define the range over which a random number will be selected. If you wanted the random start point to be between 0 and 10 seconds, you'd replace min with 0 and max with 10 so that the line looked like this:

timeOffset = random(0,10);

Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog - What I'm thinking when my workstation's thinking
Creative Cow Forum Host: Live & Stage Events


Return to posts index

Freddie Horton
Re: Play composition randomly using a selection of user-defined frame ranges?
on Jan 28, 2014 at 6:10:54 pm

thank you Walter! that is a great help


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]