same nParticles Rand Sequence


#1

Sorry guys, did a quick search but did not find this asked before

Is there a way to get the same nparticles rand sequence on every execution.

Best Regards
-tejvirs


#2

Random values are all generated from a seed value. Depending on where you are setting the rand values your seed will be easier or harder to set. Ideally you are using expressions to drive your rand values and so in that case you just need to add a seed command to the beginning of your expression.

start your particle expressions with something like this;

$seed = 97927927 + .particleID;
seed $seed;

This will give each particle a different repeatable random-ness.
For non particle related expressions you can just use;

seed 986194979;

FYI the number you use for the seed can be any number

A if you want a new repeatable rand number every frame then just use something like this for your seed:

$seed = 1231 + .particleID + frame;
seed $seed;
or
$seed = 1231 + frame;
seed $seed;

The expression docs have a whole bunch of info on the seed function. Check it out for more info.
Hopefully that helps.
~Ben


#3

Ben, this was beautifully answered.

Thanks for the knowledge.


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.