I'm creating a scene from scratch in blender (2.83+) using python, and I'd like to turn on Intel denoiser for the Cycles render output.
I've got some code but it's not working yet:
bpy.context.view_layer.cycles.denoising_store_passes = True bpy.context.scene.use_nodes = True tree = bpy.context.scene.node_tree # inputs, outputs, nodes, links comp = tree.nodes # result goes into here render = tree.nodes # render layers: images come from here denoise_node = tree.nodes.new(type='CompositorNodeDenoise') # Link it in: links = tree.links # links.new(output ---> input) link = links.new(denoise_node.outputs, comp.inputs) # XXX: find outputs by name # XXX: use "Noisy Image" output (31) rather than "Image" (0)? link = links.new(render.outputs, denoise_node.inputs) # Image link = links.new(render.outputs, denoise_node.inputs) # Denoising Normal link = links.new(render.outputs, denoise_node.inputs) # Denoising Albedo
The problem is that even though I've enabled
bpy.context.view_layer.cycles.denoising_store_passes = True it doesn't seem to have taken effect by the time the rest of my code runs; the
render node still only has 31 outputs. It should have 39.
Anyone know how I can wait for that setting to take effect before continuing?
bpy.context.view_layer.update()but that doesn't help. $\endgroup$
render.update()-- also no effect. $\endgroup$