Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions [Script] How to select random keyframes?

  • Filip Vandueren

    November 12, 2020 at 9:28 am

    Define random ? How many ? If you have a comp with 200 keyframes, random could return 0 keyframe or 200. Do you need a minimum? Or 50% at random ?

  • Filip Vandueren

    November 12, 2020 at 9:39 am

    You could change line 53 to:

    prop.setSelectedAtKey(ii, Math.random()<0.5);

    for a 50% probability a property will be selected.

    and change line 52 to:

        for (var ii = 1; ii <=prop.numKeys; ii++) {

    To evaluate all keys of the properties, not just those within the workarea.
    Line 22-25 & 42-50 have no function in that case and can be commented out.

    I haven’t tested this though.

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