[Bf-extensions-cvs] [f8a51ea6] blender-v3.0-release: Fix T93391: Update BoolTool addon for visibility breaking change

Jesse Yurkovich noreply at git.blender.org
Mon Nov 29 21:08:34 CET 2021


Commit: f8a51ea60a533bd8158d93bd0ef394a61fc96a85
Author: Jesse Yurkovich
Date:   Mon Nov 29 12:04:22 2021 -0800
Branches: blender-v3.0-release
https://developer.blender.org/rBAf8a51ea60a533bd8158d93bd0ef394a61fc96a85

Fix T93391: Update BoolTool addon for visibility breaking change

The visibility settings were moved from Object.cycles_visibility.setting
to Object.setting in August. However, some addons like bool tool were
not updated to account for this.

Differential Revision: https://developer.blender.org/D13375

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

M	object_boolean_tools.py

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

diff --git a/object_boolean_tools.py b/object_boolean_tools.py
index 3000f588..05a9cf23 100644
--- a/object_boolean_tools.py
+++ b/object_boolean_tools.py
@@ -80,18 +80,13 @@ def isBrush(_obj):
 #         return False
 
 
-def cycles_visibility_set(ob, value=False):
-    if not hasattr(ob, "cycles_visibility"):
-        return
-
-    vis = ob.cycles_visibility
-
-    vis.camera = value
-    vis.diffuse = value
-    vis.glossy = value
-    vis.shadow = value
-    vis.transmission = value
-    vis.scatter = value
+def object_visibility_set(ob, value=False):
+    ob.visible_camera = value
+    ob.visible_diffuse = value
+    ob.visible_glossy = value
+    ob.visible_shadow = value
+    ob.visible_transmission = value
+    ob.visible_volume_scatter = value
 
 
 def BT_ObjectByName(obj):
@@ -147,7 +142,7 @@ def Operation(context, _operation):
             else:
                 selObj.display_type = "BOUNDS"
 
-            cycles_visibility_set(selObj, value=False)
+            object_visibility_set(selObj, value=False)
 
             if _operation == "SLICE":
                 # copies instance_collection property(empty), but group property is empty (users_group = None)
@@ -191,7 +186,7 @@ def Remove(context, thisObj_name, Prop):
                 obj.display_type = "TEXTURED"
                 del obj["BoolToolBrush"]
                 del obj["BoolTool_FTransform"]
-                cycles_visibility_set(obj, value=True)
+                object_visibility_set(obj, value=True)
 
                 # Remove it from the Canvas
                 for mod in actObj.modifiers:
@@ -216,7 +211,7 @@ def Remove(context, thisObj_name, Prop):
             actObj.display_type = "TEXTURED"
             del actObj["BoolToolBrush"]
             del actObj["BoolTool_FTransform"]
-            cycles_visibility_set(actObj, value=True)
+            object_visibility_set(actObj, value=True)
 
         if Prop == "CANVAS":
             for mod in actObj.modifiers:



More information about the Bf-extensions-cvs mailing list