[Bf-extensions-cvs] [dc0def22] master: Collection Manager: Improve SetCollection Operator. Task: T69577

Ryan Inch noreply at git.blender.org
Mon Jan 6 07:01:43 CET 2020


Commit: dc0def220d6f1dccc5fb3dae079fbed548026d00
Author: Ryan Inch
Date:   Mon Jan 6 00:58:07 2020 -0500
Branches: master
https://developer.blender.org/rBAdc0def220d6f1dccc5fb3dae079fbed548026d00

Collection Manager: Improve SetCollection Operator. Task: T69577

Reduces complexity when setting objects' collections.

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

M	object_collection_manager/__init__.py
M	object_collection_manager/operators.py

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

diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py
index ab34c24c..e624083c 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": (1,8,4),
+    "version": (1,8,5),
     "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/operators.py b/object_collection_manager/operators.py
index 604eb752..ce1c4178 100644
--- a/object_collection_manager/operators.py
+++ b/object_collection_manager/operators.py
@@ -141,13 +141,7 @@ class CMSetCollectionOperator(Operator):
             # add object to collection
 
             # check if in collection
-            in_collection = True
-
-            for obj in context.selected_objects:
-                if obj.name not in collection.objects:
-                    in_collection = False
-
-            if not in_collection:
+            if context.active_object.name not in collection.objects:
                 # add to collection
                 bpy.ops.object.link_to_collection(collection_index=self.collection_index)



More information about the Bf-extensions-cvs mailing list