Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random choose a frame from comp

  • Random choose a frame from comp

    Posted by Johannes Edberg on April 13, 2022 at 12:19 pm

    Hi. I’m trying to choose a random frame from a comp and then time-remap freeze that frame in another comp.

    So:
    COMP1: Have 10 pics and is 10 frames long – 1 pic per frame.
    COMP2: I have put COMP1 in COMP2 and want it to show a randomized frame and freeze it.

    When duplicating COMP2 the new copy should show a new random frame from COMP1.

    How do I do this?
    Thanks for the help

    Walter Soyka replied 4 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Walter Soyka

    April 13, 2022 at 7:16 pm

    Enable time-remapping for your COMP1 layer inside COMP2, then apply this expression:

    seedRandom(index, true);
    random()*thisLayer.source.duration;

    The first line tells Ae to use the layer’s index as the seed for the random number generator, and sets “timeless” to true, meaning the random numbers returned will not change from frame-to-frame. The second line picks a random number from 0 to 1, then scales it to the duration of your original precomp.

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