Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random Color but changing every 5 frames

  • Random Color but changing every 5 frames

    Posted by Brian Hughes on April 22, 2008 at 6:06 pm

    Hi.. I never use expressions but I need to, HELP! hehe

    I’m trying to make random colors. Here is how far I’ve gotten I figured out the expression to change the color I”m using the Color Balance (HLS) effect and on the Hue property I used the expression “Random (1,360)” The problem is that changes the color every frame, I need to slow that down and only have it change after 5 frames then the next 5 and so on.

    Thanks!
    Brian : )

    John Percival replied 15 years, 9 months ago 4 Members · 3 Replies
  • 3 Replies
  • Darby Edelen

    April 22, 2008 at 10:12 pm

    The easiest way to do this is to limit the number of times the expression evaluates with the posterizeTime(fps); function, like so:


    x = 5;
    f = thisComp.frameDuration * x; //The duration in seconds of 'x' frames in this composition

    posterizeTime(1 / f); //Evaluate everything after this line every x frames

    random(1, 360);

    Darby Edelen
    Lead Designer
    Left Coast Digital
    Santa Cruz, CA

  • Clarisse Rodriguez

    May 19, 2010 at 5:54 pm

    Question for Darby:

    How would one go about making the same expression, but having the rate of the changing colors also be random (as opposed to 5)?

    Thanks!!

    ——————————
    https://www.vimeo.com/clarissecastelo

  • John Percival

    August 13, 2010 at 5:04 pm

    Clarisse, you can set a variable equal to random() and if you need to increase the amount of random you can pass in a hard value of 100 or even 1000 depending on the amount you need for your comp.

    I use random(time*100)

    Hope this helps.

    random()

    random(time*100)

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