Page MenuHome

python 'seed_set(x)' seems to be not doing nothing for noise generating function.
Closed, ResolvedPublic

Description

when executing python commands:
noise.seed_set(4)

Seed initialization gives no effect on output of random number generator:
noise.noise_vector(mathutils.Vector((1,1,1)), mathutils.noise.types.STDPERLIN)

Meaning output stays the same, but it should change with each seed change.

blend file with simple script for testing:


Just change number in 'noise.seed_set(4)' to see no difference on output

Revisions and Commits

Event Timeline

Jose Conseco (joseconseco) raised the priority of this task from to 90.
Jose Conseco (joseconseco) updated the task description. (Show Details)
Jose Conseco (joseconseco) edited a custom field.

as a workaround i can add random number to input Vector for:
noise.noise_vector(InputVector + RandoVector, noisetype)

And it work as seed ok, for now.

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to 50.Mar 29 2016, 11:12 PM

The code is calling out to API's which don't use the random seed.

Making this work isn't some simple fix, however we could use the seed to re-position the point used to get noise (currently values are hard-coded), see:
https://developer.blender.org/diffusion/B/browse/master/source/blender/python/mathutils/mathutils_noise.c;29bb10ee964a23df393442ceb98ddaf747c8c5f1$198-205

Sounds good to me. I'm basically doing the same thing in post above :) in python.