Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Want to do a random frame hold

  • Want to do a random frame hold

    Posted by Kevin Camin on March 16, 2012 at 3:40 pm

    How can I do a random frame hold on a precomp?

    My end goal is to create a precomp with many still photos one frame each, distributed evenly in time. Then have the expression choose one frame randomly to hold on. Then I’ll duplicate this many times to create a large field of postcards.

    Anyways I researched some scripts online but none of them are working for me. My comp is 8 frames in length and all the expressions I’ve tried locks the time at one frame past my last frame. Any help will be appreciated.

    Best regards,

    Kevin Camin

    Jordan Santiago replied 8 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 16, 2012 at 4:44 pm

    Try this:

    seedRandom(index,true);
    myFrame = Math.floor(random(8));
    framesToTime(myFrame)

    Dan

  • Kevin Camin

    March 16, 2012 at 5:43 pm

    Worked like a charm. Thanks so much, Dan!

    Best regards,

    Kevin Camin

  • Jordan Santiago

    June 26, 2017 at 7:03 pm

    Five years later and this is till helping people. Well, me at least. Thank you, Dan!

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