How to access Denoising settings in Cycles via API?

Hello,

How to access denoising and its settings in Cycles via API in 2.8? None of the following commands work:

bpy.data.scenes['Scene'].cycles.use_denoising = True
bpy.context.scene.render.layers[0].cycles.use_denoising = True
bpy.context.scene.render.view_layer.cycles.use_denoising = True
bpy.context.scene.render.layers['RenderLayer'].cycles.use_denoising = True

You need to update the data path from where to pull these properties. Denoising is a per View Layer setting, so the following code would grab the denoising settings for a View Layer called View Layer:

bpy.context.scene.view_layers['View Layer'].cycles.use_denoising
2 Likes

Thanks! You saved my week.