Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random hold periods

  • random hold periods

    Posted by Jason Corder on May 7, 2009 at 4:07 am

    i’m trying to create an expression that periodically turns the opacity of a layer to 100% but then holds that opacity value at 100 for a period of say, 10 frames of time. here’s what i’ve got so far…

    x=random(50);
    if(x>45){
    value=100;
    }else{
    value=0;
    }

    obviously that expression produces some chaotic results as a new random number for ‘x’ is created at every frame. so how can i create the hold? if anybody has an example or link to another post here that would be awesome!

    Darren Hardaway replied 17 years ago 2 Members · 3 Replies
  • 3 Replies
  • Darren Hardaway

    May 7, 2009 at 6:50 am

    see if this works

    wiggle(1,100)

    it worked pretty well for me, kinda random and it held the 100% opacity for a good amount of time.

  • Jason Corder

    May 7, 2009 at 4:02 pm

    hey thanks for the feedback! i guess i was looking for more of a square wav with some pulse width modulation to achieve a slow ‘geiger counter’ esque pulse light effect. so the layer triggers ‘on’ only every so often and stays on for a slightly varying period of time(the goal is between 1-2 seconds)…

    maybe an expression slider in null layer with a posterizeTime(3) or something attached to the if/else statement in the opacity of the other layer would do the trick?

  • Darren Hardaway

    May 13, 2009 at 4:32 am

    hehehe, I don’t even know what posterizeTime does, I’m just really starting with expressions. But what I think you are trying to do is force the solid to hold 100 opacity for a random time between 1-2 seconds? You could use an if/else to tell it when to turn “on” but how to use a random number generator to tell how long to stay “on” then turn “off” would be beyond me.

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