Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random on off, flicker too fast

  • random on off, flicker too fast

    Posted by Anthony Dupsta on June 16, 2007 at 12:06 am

    Looking to Have the opacity of a couple layers turn on and off. Like windows in a building of a time lapse city.
    I have tried flicker but it is to fast. Wiggle seems to be doing a dissolve.
    Ideally the layer goes on for 1 sec turns off for half sec comes back on in 2 sec. Random off on Etc.
    I don’t mind setting random toggle hold frames in opacity but is there a way to do it with an expression?

    Any other advice welcome

    Dorus Van lieshout replied 14 years, 6 months ago 5 Members · 5 Replies
  • 5 Replies
  • Julian Sixx

    June 16, 2007 at 5:49 am

    Hi

    maybe sth. like this

    seedRandom(index, 1);
    wiggle(0.04, 0.5, octaves = 5, amp_mult = 100)

    or this one from Dan

    LightOn =1;
    LightOff =0.5;

    t = Math.round(time)%(LightOn +LightOff);
    if (t >= LightOn) 100 else 0

    But all layers turn on+off at the same time.Dan,Filip how would you add some randomness to it?

  • Dan Ebberts

    June 16, 2007 at 6:21 am

    This seems to work:

    minOnTime = .5;
    maxOnTime = 2.0;
    minOffTime = .5;
    maxOffTime = 1.5;

    i = 0;
    tEnd = 0;
    seedRandom(index,true);

    preRun = random(maxOnTime);
    while (time + preRun >= tEnd){
    i++;
    if(i%2){
    tEnd += random(minOnTime,maxOnTime);
    result = 100;
    }else{
    tEnd += random(minOffTime,maxOffTime);
    result = 0;
    }
    }
    result

    Dan

  • Bas V breugel

    September 8, 2010 at 1:44 pm

    Dan, were do I paste your expression? Position/Opacity/ect? from the layer

  • Bas V breugel

    September 8, 2010 at 1:45 pm

    dumb question.. opacity it is.

  • Dorus Van lieshout

    October 25, 2011 at 12:38 pm

    Come on Bas, this was peanuts when we where in Art school together 😉

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