PDA

View Full Version : Random Expression



IRML
08-06-2007, 07:07 AM
does anyone know how to use an expression in the graph editor to randomise the position of a single frame? I've been playing with 'random(1,100)' for a while now but I can't find a way to stop it from randomising every frame, I'd like the whole channel to be offset by the same random amount but at the moment all I get is a noisy pattern

I hope that makes sense

Red_Oddity
08-06-2007, 08:56 AM
random isn't a seeded random, i suggest using the noisy channel modifier, or write an LScript that uses a modifier that uses say the Mersenne twister algorithm.

Red_Oddity
08-06-2007, 09:12 AM
Oh yeah, and Noisy Channel Scale setting seems nerfed.

if you want a value from say 0 to 1 you need to set your Offset to 0.5 and the Scale to 2 (for some reason Scale needs to be twice the size of the actual value you want...go figure)

So in your case it would be Offset 50 and Scale 200.

Red_Oddity
08-08-2007, 09:57 AM
Just realised you could also use Relativity ofcourse
Just use FRAC or NOISE functions.

for example:
1 + (0.5 + NOISE(#frm)) * 99

Sekhar
06-19-2009, 12:13 AM
I have the same problem, does anyone have a solution? Red, I don't think you really answered what IRML wanted (or at least what I need). Basically, I'm looking to add a random constant to an expression. All the random functions in LW seem to calculate values every frame, not once at the beginning.

E.g., say we have an expression sin(Time). I need to add a random phase to this. Making it something like sin(Time+random(0,rad(180))) won't work because LW calculates the random shift EVERY FRAME, whereas what I need is calculate it once and add the same shift in every frame.