Commit: 633d314b75a1e84c9ed93e09047f87f34ddab802
Author: Michael Jones
Date:   Tue Oct 25 19:36:13 2022 +0100
Branches: master
https://developer.blender.org/rB633d314b75a1e84c9ed93e09047f87f34ddab802

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

===================================================================

M       intern/cycles/blender/addon/ui.py

===================================================================

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':

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to