Flamenco: disable Cycles denoiser when progressive rendering

The denoiser data cannot be (easily) merged, so for now we just disable
the denoiser.
This commit is contained in:
Sybren A. Stüvel 2019-01-30 16:01:54 +01:00
parent 924fb45cb2
commit 53fa3e628a

View File

@ -436,6 +436,14 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
old_use_overwrite = render.use_overwrite old_use_overwrite = render.use_overwrite
old_use_placeholder = render.use_placeholder old_use_placeholder = render.use_placeholder
disable_denoiser = (context.scene.flamenco_render_job_type == 'blender-render-progressive'
and render.engine == 'CYCLES')
if disable_denoiser:
use_denoising = [layer.cycles.use_denoising
for layer in context.scene.view_layers]
else:
use_denoising = []
try: try:
# The file extension should be determined by the render settings, not necessarily # The file extension should be determined by the render settings, not necessarily
@ -446,6 +454,10 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
render.use_overwrite = False render.use_overwrite = False
render.use_placeholder = False render.use_placeholder = False
if disable_denoiser:
for layer in context.scene.view_layers:
layer.cycles.use_denoising = False
filepath = Path(context.blend_data.filepath).with_suffix('.flamenco.blend') filepath = Path(context.blend_data.filepath).with_suffix('.flamenco.blend')
self.log.info('Saving copy to temporary file %s', filepath) self.log.info('Saving copy to temporary file %s', filepath)
bpy.ops.wm.save_as_mainfile(filepath=str(filepath), bpy.ops.wm.save_as_mainfile(filepath=str(filepath),
@ -457,6 +469,10 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
render.use_overwrite = old_use_overwrite render.use_overwrite = old_use_overwrite
render.use_placeholder = old_use_placeholder render.use_placeholder = old_use_placeholder
if disable_denoiser:
for denoise, layer in zip(use_denoising, context.scene.view_layers):
layer.cycles.use_denoising = denoise
return filepath return filepath
async def bat_pack(self, filepath: Path) \ async def bat_pack(self, filepath: Path) \
@ -885,6 +901,9 @@ class FLAMENCO_PT_render(bpy.types.Panel, FlamencoPollMixin):
text='Recommended Max Samples per Task: %d' % recommended_cap) text='Recommended Max Samples per Task: %d' % recommended_cap)
props.sample_cap = recommended_cap props.sample_cap = recommended_cap
if any(layer.cycles.use_denoising for layer in context.scene.view_layers):
box.label(text='Progressive Rendering will disable Denoising.', icon='ERROR')
labeled_row = layout.split(**blender.factor(0.25), align=True) labeled_row = layout.split(**blender.factor(0.25), align=True)
labeled_row.label(text='Frame Range:') labeled_row.label(text='Frame Range:')
prop_btn_row = labeled_row.row(align=True) prop_btn_row = labeled_row.row(align=True)