Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

barrypsuydam
Topic Author
Posts: 9
Joined: Thu May 07, 2009 11:01 am

### Random Hold opacity

I was wondering if anyone knows how to randomize opacity but while fully opaque hold for random time(1 or 2 sec) then continue.

Mylenium
Posts: 139
Joined: Wed Jul 20, 2005 12:07 am

### Re: Random Hold opacity

barrypsuydam wrote:
I was wondering if anyone knows how to randomize opacity but while fully opaque hold for random time(1 or 2 sec) then continue.

Math.round in combination with a wiggle() or as an alternative, random() used with an array and combined with posterizeTime().

Mylenium
[Pour MylÃ¨ne, ange sur terre]

barrypsuydam
Topic Author
Posts: 9
Joined: Thu May 07, 2009 11:01 am

### Re: Random Hold opacity

I am new to expressions...and I am sorry to bug you...but can you show me what an example would look like?

Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

### Re: Random Hold opacity

Try adding this expression to the Opacity property:
wiggle(1,100);

Then turn on the little graph icon beside the = icon (the icons that appear below the property value when you add an expression) and switch to the graph editor to see the results of the expression. The = icon is the expression on/off button, the graph icon needs to be on for the post-expression result to appear in the graph editor.

The first value in a wiggle expression controls frequency (wiggles per second) and the second controls the amount. So this example will wiggle the value once every second by up to 100%, centered around the original pre-expression value.

If the original value was 100%, you'll find the resulting values stay at 100% for quite a bit of the time, as the values are clamped at the opacity's max value of 100%.

You can also try something like this which will ensure the resulting value is 100% for even longer:
wiggle(1,100)+50;

And then just play around with the values (checking the result in the graph editor) to see if you can get a result you like.

### Who is online

Users browsing this forum: No registered users and 1 guest