Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Play composition randomly using a selection of user-defined frame ranges?

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

    Posted by Freddie Horton on January 27, 2014 at 8:50 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!

    Freddie Horton replied 12 years, 3 months ago 3 Members · 4 Replies
  • 4 Replies
  • Stuart Paciej

    January 27, 2014 at 11:12 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

  • Freddie Horton

    January 28, 2014 at 11:04 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!

  • Walter Soyka

    January 28, 2014 at 2:32 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

  • Freddie Horton

    January 28, 2014 at 6:10 pm

    thank you Walter! that is a great help

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy