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.
This commit is contained in:
Ryan Inch 2020-11-15 20:37:33 -05:00
parent 8b555809bb
commit 451d434663
3 changed files with 31 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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}"