From 633d314b75a1e84c9ed93e09047f87f34ddab802 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Tue, 25 Oct 2022 19:36:13 +0100 Subject: Fix T101790: MNEE caustic settings are not visible in the UI when using Metal This patch fixes T101790 by adding a macOS version check for deciding whether to show the caustics settings in the UI (MNEE kernels don't compile on macOS < 13.0) Reviewed By: brecht Maniphest Tasks: T101790 Differential Revision: https://developer.blender.org/D16339 --- intern/cycles/blender/addon/ui.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index f763fe0eb0b..581533db0b6 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -149,6 +149,14 @@ def get_effective_preview_denoiser(context): return 'OIDN' +def use_mnee(context): + # The MNEE kernel doesn't compile on macOS < 13. + if use_metal(context): + import platform + v, _, _ = platform.mac_ver() + if float(v) < 13.0: + return False + return True class CYCLES_RENDER_PT_sampling(CyclesButtonsPanel, Panel): bl_label = "Sampling" @@ -1235,7 +1243,7 @@ class CYCLES_OBJECT_PT_shading_caustics(CyclesButtonsPanel, Panel): @classmethod def poll(cls, context): - return CyclesButtonsPanel.poll(context) and not use_metal(context) and context.object.type != 'LIGHT' + return CyclesButtonsPanel.poll(context) and use_mnee(context) and context.object.type != 'LIGHT' def draw(self, context): layout = self.layout @@ -1449,7 +1457,7 @@ class CYCLES_LIGHT_PT_light(CyclesButtonsPanel, Panel): sub.active = not (light.type == 'AREA' and clamp.is_portal) sub.prop(clamp, "cast_shadow") sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance") - if not use_metal(context): + if use_mnee(context): sub.prop(clamp, "is_caustics_light", text="Shadow Caustics") if light.type == 'AREA': -- cgit v1.2.3