Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Randomize Transparency using Checkbox + Duration?

  • Randomize Transparency using Checkbox + Duration?

    Posted by Giacomo Bompan on May 7, 2015 at 1:47 pm

    Hello everyone,

    I have a grid of squares, and I need to randomize the transparency (on/off) of each square in this grid;

    I am using the expression pasted below applied to each square’s transparency, so when the checkbox is set to ‘0’ the square is off, and when it’s 100 it’s on.

    I now need to randomize the on/off cycle of each square independently;

    If I apply the wiggle to randomize the on/off cycle I cannot control the duration of the 2 phases, while I need the boxes to be ‘on’ for a maximum of (let’s say) 1 to 2 seconds, and off for something between 3 to 8 seconds.

    Is there any way to assign a range of time for the 0 and 100 value of the checkbox?

    Thank you very much in advance

    Giacomo

    effect("Checkbox Control")("Checkbox")*100

    Giacomo Bompan replied 11 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 7, 2015 at 3:25 pm

    Something like this maybe:


    t = tPrev = inPoint;
    while (t <= time){
    tPrev = t;
    seedRandom(t,true);
    tOn = random(1,2);
    tOff = random(3,8);
    t += tOn+tOff;
    }
    if (time < tPrev + tOn) 100 else 0;

    Dan

  • Giacomo Bompan

    May 8, 2015 at 9:37 am

    maaan thank you very much! It works just fine 🙂

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