Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
gerardjuarez
Topic Author
Posts: 2
Joined: Fri Mar 28, 2008 10:00 am

Simple expression for varying opacity over specific time

Fri Mar 28, 2008 11:50 am

Hello,

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:

random(60,20)

Easy.

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!

Thanks!

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

Re: Simple expression for varying opacity over specific time

Fri Mar 28, 2008 12:08 pm

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.
wiggle(1,20);

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.
posterizeTime(2);
random(20,60);
 
gerardjuarez
Topic Author
Posts: 2
Joined: Fri Mar 28, 2008 10:00 am

Re: Simple expression for varying opacity over specific time

Fri Mar 28, 2008 12:32 pm

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

Who is online

Users browsing this forum: No registered users and 2 guests