1
$\begingroup$

I have code that procedurally generates images with a lot of random values for models, lighting, textures, etc.. Part of this process is randomly shifting hue/saturation/value in the compositor to get a wide range of rendered images. A problem I am having with Blender 2.80 is that the random values in the compositor are always the same each time I run the script.

In order to test things I wrote a simple script that imports a scene with the compositor setup and prints the hue value. The hue node uses the #noise.random() expression (which does work in the editor in all versions of Blender). Here is the code:

import bpy
path = "D:\\virtual_imagery\\render_data\\plot_row\\procedural-scene.blend"
with bpy.data.libraries.load(path) as (data_from, data_to):
    setattr(data_to, "scenes", ["procedural"])
bpy.data.scenes.remove(bpy.data.scenes["Scene"], do_unlink=True)
print(bpy.context.scene.node_tree.nodes["Hue Saturation Value"].inputs["Hue"].default_value)

Each time I run the script with blender 2.79 I get a different value. Each time I run the script with blender 2.80 I get the same value.

Am I missing something? Is it possible I discovered a bug?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.