diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-11-16 04:37:33 +0300 |
---|---|---|
committer | Ryan Inch <mythologylover75@gmail.com> | 2020-11-16 04:37:33 +0300 |
commit | 451d4346637a6216499c290eb1a7d9c3df1711b6 (patch) | |
tree | 83b30ee7f29e22d9ff18b7ccc0f34ffd72943fd9 | |
parent | 8b555809bb31d7bfa929681f396d9a836f7e8acc (diff) |
Collection Manager: Fix object selection error. Task: T69577
Fix the select collection objects function executing in editing
modes and erroring out.
Remove object selection references from tooltips when in editing
modes.
-rw-r--r-- | object_collection_manager/__init__.py | 2 | ||||
-rw-r--r-- | object_collection_manager/operator_utils.py | 3 | ||||
-rw-r--r-- | object_collection_manager/qcd_operators.py | 36 |
3 files changed, 31 insertions, 10 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 9ccc3d45..4109798d 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, 17, 2), + "version": (2, 17, 3), "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 2544b76b..ce06b3d1 100644 --- a/object_collection_manager/operator_utils.py +++ b/object_collection_manager/operator_utils.py @@ -493,6 +493,9 @@ def remove_collection(laycol, collection, context): def select_collection_objects(is_master_collection, collection_name, replace, nested, selection_state=None): + if bpy.context.mode != 'OBJECT': + return + if is_master_collection: target_collection = bpy.context.view_layer.layer_collection.collection diff --git a/object_collection_manager/qcd_operators.py b/object_collection_manager/qcd_operators.py index c9ecf5d5..14e79a0b 100644 --- a/object_collection_manager/qcd_operators.py +++ b/object_collection_manager/qcd_operators.py @@ -145,13 +145,25 @@ class QCDAllBase(): class EnableAllQCDSlotsMeta(Operator): '''QCD All Meta Operator''' bl_label = "Quick View Toggles" - bl_description = ( - " * LMB - Enable all slots/Restore.\n" - " * Alt+LMB - Select all objects in QCD slots.\n" - " * LMB+Hold - Menu" - ) bl_idname = "view3d.enable_all_qcd_slots_meta" + @classmethod + def description(cls, context, properties): + selection_hotkeys = "" + + if context.mode == 'OBJECT': + selection_hotkeys = ( + " * Alt+LMB - Select all objects in QCD slots.\n" + ) + + hotkey_string = ( + " * LMB - Enable all slots/Restore.\n" + + selection_hotkeys + + " * LMB+Hold - Menu" + ) + + return hotkey_string + def invoke(self, context, event): global qcd_slots global layer_collections @@ -574,16 +586,22 @@ class ViewMoveQCDSlot(Operator): global qcd_slots slot_name = qcd_slots.get_name(properties.slot) - slot_string = f"QCD Slot {properties.slot}: \"{slot_name}\"\n" + selection_hotkeys = "" + + if context.mode == 'OBJECT': + selection_hotkeys = ( + ".\n" + " * Alt+LMB - Select objects in slot.\n" + " * Alt+Shift+LMB - Toggle objects' selection for slot" + ) hotkey_string = ( " * LMB - Isolate slot.\n" " * Shift+LMB - Toggle slot.\n" " * Ctrl+LMB - Move objects to slot.\n" - " * Ctrl+Shift+LMB - Toggle objects' slot.\n" - " * Alt+LMB - Select objects in slot.\n" - " * Alt+Shift+LMB - Toggle objects' selection for slot" + " * Ctrl+Shift+LMB - Toggle objects' slot" + + selection_hotkeys ) return f"{slot_string}{hotkey_string}" |