Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Yurkovich <jesse.y@gmail.com>2021-11-29 23:04:22 +0300
committerJesse Yurkovich <jesse.y@gmail.com>2021-11-29 23:04:22 +0300
commitf8a51ea60a533bd8158d93bd0ef394a61fc96a85 (patch)
tree625c421bb8a2b07f29d3cd5bda36ebd0182ef94e
parent64537a0df535cdceeea003deadcd5bb1a5242573 (diff)
Fix T93391: Update BoolTool addon for visibility breaking changev3.0.0
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
-rw-r--r--object_boolean_tools.py25
1 files changed, 10 insertions, 15 deletions
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: