Simple expression for varying opacity over specific time

Moderators: Disciple, zlovatt

Post Reply
Posts: 2
Joined: March 28th, 2008, 10:00 am


I have a layer I want to vary the opacity of in a random way between certain values so I enable expressions for the opacity and use the following:



However, I don't want this value to be randomized on every frame, but rather every 15 frames or .5 seconds. It's probably way simple for some of you, but for me scripting is rather challenging!


Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

If you want something that gradually changes over time, you could set the Opacity value to the middle of your desired value range (i.e halfway between 20-60 is 40) then use this expression. The first number is wiggles per second, the second number is the max amount the value will change.

Or if you want an abrupt change in value, but not on every frame, you could use this expression. Although the second line would normally create a new random value between 20 and 60 on each frame, the preceding posterizeTime(frames per second) method is lowering the frame rate of the resulting expression.
Posts: 2
Joined: March 28th, 2008, 10:00 am

perfect - works for me! Thank you much! -g
Post Reply