diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-11-16 04:37:33 +0300 |
---|---|---|
committer | Ryan Inch <mythologylover75@gmail.com> | 2020-11-16 05:05:39 +0300 |
commit | 51ea73b0c948315b544e962ab97825f6aa0d62ed (patch) | |
tree | a7d65e5aeff38b94be39bb7009841f855be9c685 | |
parent | 35c23b4db494e58538a677c4fb0ec9ec1e8ffaa8 (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, 32 insertions, 9 deletions
diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 52417fab..9f88c0e7 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, 18, 2), + "version": (2, 18, 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 393086f7..8b637a57 100644 --- a/object_collection_manager/operator_utils.py +++ b/object_collection_manager/operator_utils.py @@ -490,6 +490,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 9c139202..9333fb31 100644 --- a/object_collection_manager/qcd_operators.py +++ b/object_collection_manager/qcd_operators.py @@ -140,13 +140,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): qab = QCDAllBase @@ -553,13 +565,21 @@ class ViewMoveQCDSlot(Operator): def description(cls, context, properties): 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}" |