[Bf-extensions-cvs] [51ea73b0] master: Collection Manager: Fix object selection error. Task: T69577

Ryan Inch noreply at git.blender.org
Mon Nov 16 03:09:31 CET 2020


Commit: 51ea73b0c948315b544e962ab97825f6aa0d62ed
Author: Ryan Inch
Date:   Sun Nov 15 20:37:33 2020 -0500
Branches: master
https://developer.blender.org/rBA51ea73b0c948315b544e962ab97825f6aa0d62ed

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.

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

M	object_collection_manager/__init__.py
M	object_collection_manager/operator_utils.py
M	object_collection_manager/qcd_operators.py

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

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



More information about the Bf-extensions-cvs mailing list