python 'seed_set(x)' seems to be not doing nothing for noise generating function. #47993

Closed
opened 2016-03-29 18:59:41 +02:00 by Jose Conseco · 8 comments

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:
SeedRandom.blend
Just change number in 'noise.seed_set(4)' to see no difference on output

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: [SeedRandom.blend](https://archive.blender.org/developer/F299398/SeedRandom.blend) Just change number in 'noise.seed_set(4)' to see no difference on output
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @JoseConseco

Added subscriber: @JoseConseco
Author

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.

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.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

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

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
Author

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

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

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by blender/blender@722d586257

This issue was referenced by blender/blender@722d586257aba3138980d31768b605b4bf35f1df
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#47993
No description provided.