diff options
author | Ryan Inch <mythologylover75@gmail.com> | 2020-01-06 08:58:07 +0300 |
---|---|---|
committer | Ryan Inch <mythologylover75@gmail.com> | 2020-01-06 08:58:07 +0300 |
commit | dc0def220d6f1dccc5fb3dae079fbed548026d00 (patch) | |
tree | bea4e4f64f99cc350f9e406ab216b78f574c211e /object_collection_manager | |
parent | 42d5e009be49e560f3e4ebe42b6c4aa0721bef44 (diff) |
Collection Manager: Improve SetCollection Operator. Task: T69577
Reduces complexity when setting objects' collections.
Diffstat (limited to 'object_collection_manager')
-rw-r--r-- | object_collection_manager/__init__.py | 2 | ||||
-rw-r--r-- | object_collection_manager/operators.py | 8 |
2 files changed, 2 insertions, 8 deletions
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) |