[Bf-extensions-cvs] [4eb733d8] master: Collection Manager: Cleanup. Task: T69577

Ryan Inch noreply at git.blender.org
Tue Jul 21 06:34:33 CEST 2020


Commit: 4eb733d819f2c3f873202ba645e411526ffc469f
Author: Ryan Inch
Date:   Tue Jul 21 00:33:05 2020 -0400
Branches: master
https://developer.blender.org/rBA4eb733d819f2c3f873202ba645e411526ffc469f

Collection Manager: Cleanup. Task: T69577

Standardize setting operator properties.

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

M	object_collection_manager/__init__.py
M	object_collection_manager/ui.py

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

diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index 1b33c549..f6a31695 100644
--- a/object_collection_manager/__init__.py
+++ b/object_collection_manager/__init__.py
@@ -22,7 +22,7 @@ bl_info = {
     "name": "Collection Manager",
     "description": "Manage collections and their objects",
     "author": "Ryan Inch",
-    "version": (2, 9, 4),
+    "version": (2, 9, 5),
     "blender": (2, 80, 0),
     "location": "View3D - Object Mode (Shortcut - M)",
     "warning": '',  # used for warning icon and text in addons panel
diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py
index 76c44bb0..6d576029 100644
--- a/object_collection_manager/ui.py
+++ b/object_collection_manager/ui.py
@@ -305,11 +305,13 @@ class CollectionManager(Operator):
 
         # add collections
         addcollec_row = layout.row()
-        addcollec_row.operator("view3d.add_collection", text="Add Collection",
-                               icon='COLLECTION_NEW').child = False
+        prop = addcollec_row.operator("view3d.add_collection", text="Add Collection",
+                               icon='COLLECTION_NEW')
+        prop.child = False
 
         addcollec_row.operator("view3d.add_collection", text="Add SubCollection",
-                               icon='COLLECTION_NEW').child = True
+                               icon='COLLECTION_NEW')
+        prop.child = True
 
         # phantom mode
         phantom_row = layout.row()
@@ -558,8 +560,9 @@ class CM_UL_items(UIList):
             highlight = bool(exclude_history and exclude_target == item.name)
             icon = 'CHECKBOX_DEHLT' if laycol["ptr"].exclude else 'CHECKBOX_HLT'
 
-            row.operator("view3d.exclude_collection", text="", icon=icon,
-                         emboss=highlight, depress=highlight).name = item.name
+            prop = row.operator("view3d.exclude_collection", text="", icon=icon,
+                         emboss=highlight, depress=highlight)
+            prop.name = item.name
 
         if cm.show_selectable:
             select_history_base = rto_history["select"].get(view_layer.name, {})
@@ -570,8 +573,9 @@ class CM_UL_items(UIList):
             icon = ('RESTRICT_SELECT_ON' if laycol["ptr"].collection.hide_select else
                     'RESTRICT_SELECT_OFF')
 
-            row.operator("view3d.restrict_select_collection", text="", icon=icon,
-                         emboss=highlight, depress=highlight).name = item.name
+            prop = row.operator("view3d.restrict_select_collection", text="", icon=icon,
+                         emboss=highlight, depress=highlight)
+            prop.name = item.name
 
         if cm.show_hide_viewport:
             hide_history_base = rto_history["hide"].get(view_layer.name, {})
@@ -581,8 +585,9 @@ class CM_UL_items(UIList):
             highlight = bool(hide_history and hide_target == item.name)
             icon = 'HIDE_ON' if laycol["ptr"].hide_viewport else 'HIDE_OFF'
 
-            row.operator("view3d.hide_collection", text="", icon=icon,
-                         emboss=highlight, depress=highlight).name = item.name
+            prop = row.operator("view3d.hide_collection", text="", icon=icon,
+                         emboss=highlight, depress=highlight)
+            prop.name = item.name
 
         if cm.show_disable_viewport:
             disable_history_base = rto_history["disable"].get(view_layer.name, {})
@@ -593,8 +598,9 @@ class CM_UL_items(UIList):
             icon = ('RESTRICT_VIEW_ON' if laycol["ptr"].collection.hide_viewport else
                     'RESTRICT_VIEW_OFF')
 
-            row.operator("view3d.disable_viewport_collection", text="", icon=icon,
-                         emboss=highlight, depress=highlight).name = item.name
+            prop = row.operator("view3d.disable_viewport_collection", text="", icon=icon,
+                         emboss=highlight, depress=highlight)
+            prop.name = item.name
 
         if cm.show_render:
             render_history_base = rto_history["render"].get(view_layer.name, {})
@@ -605,8 +611,9 @@ class CM_UL_items(UIList):
             icon = ('RESTRICT_RENDER_ON' if laycol["ptr"].collection.hide_render else
                     'RESTRICT_RENDER_OFF')
 
-            row.operator("view3d.disable_render_collection", text="", icon=icon,
-                         emboss=highlight, depress=highlight).name = item.name
+            prop = row.operator("view3d.disable_render_collection", text="", icon=icon,
+                         emboss=highlight, depress=highlight)
+            prop.name = item.name
 
 
 
@@ -616,8 +623,8 @@ class CM_UL_items(UIList):
         row.separator()
 
         rm_op = row.row()
-        rm_op.operator("view3d.remove_collection", text="", icon='X',
-                       emboss=False).collection_name = item.name
+        prop = rm_op.operator("view3d.remove_collection", text="", icon='X', emboss=False)
+        prop.collection_name = item.name
 
 
         if len(data.cm_list_collection) > index + 1:



More information about the Bf-extensions-cvs mailing list