diff options
Diffstat (limited to 'intern/cycles/blender/addon/ui.py')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 35d5d3801d2..f23d141e3da 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -112,6 +112,10 @@ def show_device_active(context): return True return context.preferences.addons[__package__].preferences.has_active_device() +def show_optix_denoising(context): + # OptiX AI denoiser can be used when at least one device supports OptiX + return bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')) + def draw_samples_info(layout, context): cscene = context.scene.cycles @@ -177,17 +181,23 @@ class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel): if not use_optix(context): layout.prop(cscene, "progressive") - if cscene.progressive == 'PATH' or use_branched_path(context) is False: + if not use_branched_path(context): col = layout.column(align=True) col.prop(cscene, "samples", text="Render") col.prop(cscene, "preview_samples", text="Viewport") - - draw_samples_info(layout, context) else: col = layout.column(align=True) col.prop(cscene, "aa_samples", text="Render") col.prop(cscene, "preview_aa_samples", text="Viewport") + # Viewport denoising is currently only supported with OptiX + if show_optix_denoising(context): + col = layout.column() + col.prop(cscene, "preview_denoising") + + if not use_branched_path(context): + draw_samples_info(layout, context) + class CYCLES_RENDER_PT_sampling_sub_samples(CyclesButtonsPanel, Panel): bl_label = "Sub Samples" @@ -195,9 +205,7 @@ class CYCLES_RENDER_PT_sampling_sub_samples(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - scene = context.scene - cscene = scene.cycles - return cscene.progressive != 'PATH' and use_branched_path(context) + return use_branched_path(context) def draw(self, context): layout = self.layout @@ -635,9 +643,6 @@ class CYCLES_RENDER_PT_performance_tiles(CyclesButtonsPanel, Panel): sub = col.column() sub.active = not rd.use_save_buffers - for view_layer in scene.view_layers: - if view_layer.cycles.use_denoising: - sub.active = False sub.prop(cscene, "use_progressive_refine") @@ -981,15 +986,14 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel): col = split.column(align=True) - if use_optix(context): - col.prop(cycles_view_layer, "use_optix_denoising", text="OptiX AI Denoising") + if show_optix_denoising(context): + col.prop(cycles_view_layer, "use_optix_denoising") + col.separator(factor=2.0) if cycles_view_layer.use_optix_denoising: col.prop(cycles_view_layer, "denoising_optix_input_passes") return - col.separator(factor=2.0) - col.prop(cycles_view_layer, "denoising_radius", text="Radius") col.prop(cycles_view_layer, "denoising_strength", slider=True, text="Strength") col.prop(cycles_view_layer, "denoising_feature_strength", slider=True, text="Feature Strength") @@ -2192,8 +2196,6 @@ def draw_device(self, context): col = layout.column() col.prop(cscene, "feature_set") - scene = context.scene - col = layout.column() col.active = show_device_active(context) col.prop(cscene, "device") |