Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Picking random images

  • Dan Ebberts

    July 13, 2017 at 7:32 pm

    And do what with it? To which property would this expression be applied?

    Dan

  • Tom Granberg

    July 13, 2017 at 8:53 pm

    Let’s say I have a 400X400 footage file with a new face on each frame, footage is 4sec long (120faces).
    I want to drop that in my comp, place it, duplicate over and over, and each copy is showing a different face.
    Preferably without a repeat/duplicate face.

  • Tom Granberg

    July 13, 2017 at 8:57 pm

    I’ve messed with this a little bit, and it works pretty good.

    I’ve set the fr to 0.1 to allow for a long hold.
    Then adjust the numFrames to 120 to account for the entire range of the footage.

    fr = 12; // frame rate;
    numFrames = 8;
    seedRandom(index,true);
    seg = Math.floor(time*fr);
    f = Math.floor(random(numFrames));
    for (i = 0; i < seg; i++)
    f = (f + Math.floor(random(1,numFrames)))%numFrames;
    framesToTime(f);


    fr = 12; // frame rate;
    numFrames = 8;
    seedRandom(index,true);
    seg = Math.floor(time*fr);
    f = Math.floor(random(numFrames));
    for (i = 0; i &lt; seg; i++)
    f = (f + Math.floor(random(1,numFrames)))%numFrames;
    framesToTime(f);

  • Tom Granberg

    July 13, 2017 at 8:58 pm

    This is applied to the timeremap feature

  • Tom Granberg

    July 13, 2017 at 9:16 pm

    While we are on this topic.
    What is the best way to alter the above script to randomly pick a start point and play X amount of frames and then stop and hold?

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