diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index d7b312a5ed48dc9e48665e9a7ac2ab244ba217f9..e5f6a9ec189788bdcc75b7fb92c4cc4cab80f0c9 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, 14, 0), + "version": (2, 14, 1), "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/operator_utils.py b/object_collection_manager/operator_utils.py index 6f7ee83b504f22ecc5722d1a6de1acd0d61e43c8..20c7dee7a9863ec76c2daf280fcf8a843c9c993b 100644 --- a/object_collection_manager/operator_utils.py +++ b/object_collection_manager/operator_utils.py @@ -469,8 +469,8 @@ def remove_collection(laycol, collection, context): cm.cm_list_index = laycol["row_index"] -def select_collection_objects(collection_index, collection_name, replace, nested): - if collection_index == 0: +def select_collection_objects(is_master_collection, collection_name, replace, nested): + if is_master_collection: target_collection = bpy.context.view_layer.layer_collection.collection else: diff --git a/object_collection_manager/operators.py b/object_collection_manager/operators.py index ff1bbf950e21320fa5d4be0fb39c61c76604fd80..1e265e52b673a96003d3145f65efbf788ada0d85 100644 --- a/object_collection_manager/operators.py +++ b/object_collection_manager/operators.py @@ -74,11 +74,11 @@ class SetActiveCollection(Operator): bl_idname = "view3d.set_active_collection" bl_options = {'UNDO'} - collection_index: IntProperty() + is_master_collection: BoolProperty() collection_name: StringProperty() def execute(self, context): - if self.collection_index == -1: + if self.is_master_collection: layer_collection = context.view_layer.layer_collection else: @@ -227,7 +227,7 @@ class CMSelectCollectionObjectsOperator(Operator): bl_idname = "view3d.select_collection_objects" bl_options = {'REGISTER', 'UNDO'} - collection_index: IntProperty() + is_master_collection: BoolProperty() collection_name: StringProperty() def invoke(self, context, event): @@ -235,7 +235,7 @@ class CMSelectCollectionObjectsOperator(Operator): if modifiers == {"shift"}: select_collection_objects( - collection_index=self.collection_index, + is_master_collection=self.is_master_collection, collection_name=self.collection_name, replace=False, nested=False @@ -243,7 +243,7 @@ class CMSelectCollectionObjectsOperator(Operator): elif modifiers == {"ctrl"}: select_collection_objects( - collection_index=self.collection_index, + is_master_collection=self.is_master_collection, collection_name=self.collection_name, replace=True, nested=True @@ -251,7 +251,7 @@ class CMSelectCollectionObjectsOperator(Operator): elif modifiers == {"ctrl", "shift"}: select_collection_objects( - collection_index=self.collection_index, + is_master_collection=self.is_master_collection, collection_name=self.collection_name, replace=False, nested=True @@ -259,7 +259,7 @@ class CMSelectCollectionObjectsOperator(Operator): else: select_collection_objects( - collection_index=self.collection_index, + is_master_collection=self.is_master_collection, collection_name=self.collection_name, replace=True, nested=False @@ -277,11 +277,11 @@ class CMSetCollectionOperator(Operator): bl_idname = "view3d.set_collection" bl_options = {'REGISTER', 'UNDO'} - collection_index: IntProperty() + is_master_collection: BoolProperty() collection_name: StringProperty() def invoke(self, context, event): - if self.collection_index == 0: + if self.is_master_collection: target_collection = context.view_layer.layer_collection.collection else: diff --git a/object_collection_manager/qcd_operators.py b/object_collection_manager/qcd_operators.py index 4ffec5622c602ebc9cbf7fecb699b46ffc40469a..b64c87f847c598e9952036b5c5825117861b0c02 100644 --- a/object_collection_manager/qcd_operators.py +++ b/object_collection_manager/qcd_operators.py @@ -166,7 +166,7 @@ class ViewMoveQCDSlot(Operator): elif modifiers == {"alt"}: select_collection_objects( - collection_index=None, + is_master_collection=False, collection_name=qcd_slots.get_name(self.slot), replace=True, nested=False @@ -174,7 +174,7 @@ class ViewMoveQCDSlot(Operator): elif modifiers == {"alt", "shift"}: select_collection_objects( - collection_index=None, + is_master_collection=False, collection_name=qcd_slots.get_name(self.slot), replace=False, nested=False diff --git a/object_collection_manager/ui.py b/object_collection_manager/ui.py index 0f2703cb24d3b289709c8cdf2d679afdc59cd47e..4c1eb077269bf3cc0beae1b367886cd4548a85b0 100644 --- a/object_collection_manager/ui.py +++ b/object_collection_manager/ui.py @@ -159,7 +159,7 @@ class CollectionManager(Operator): prop = c_icon.operator("view3d.set_active_collection", text='', icon='GROUP', depress=highlight) - prop.collection_index = -1 + prop.is_master_collection = True prop.collection_name = 'Master Collection' master_collection_row.separator() @@ -200,7 +200,7 @@ class CollectionManager(Operator): prop = row_setcol.operator("view3d.set_collection", text="", icon=icon, emboss=False) - prop.collection_index = 0 + prop.is_master_collection = True prop.collection_name = 'Master Collection' copy_icon = 'COPYDOWN' @@ -559,7 +559,7 @@ class CM_UL_items(UIList): prop = c_icon.operator("view3d.set_active_collection", text='', icon='GROUP', emboss=highlight, depress=highlight) - prop.collection_index = laycol["row_index"] + prop.is_master_collection = False prop.collection_name = item.name if prefs.enable_qcd: @@ -599,7 +599,7 @@ class CM_UL_items(UIList): prop = set_obj_col.operator("view3d.set_collection", text="", icon=icon, emboss=False) - prop.collection_index = laycol["id"] + prop.is_master_collection = False prop.collection_name = item.name