Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Inch <mythologylover75@gmail.com>2020-01-06 08:58:07 +0300
committerRyan Inch <mythologylover75@gmail.com>2020-01-06 08:58:07 +0300
commitdc0def220d6f1dccc5fb3dae079fbed548026d00 (patch)
treebea4e4f64f99cc350f9e406ab216b78f574c211e /object_collection_manager/operators.py
parent42d5e009be49e560f3e4ebe42b6c4aa0721bef44 (diff)
Collection Manager: Improve SetCollection Operator. Task: T69577
Reduces complexity when setting objects' collections.
Diffstat (limited to 'object_collection_manager/operators.py')
-rw-r--r--object_collection_manager/operators.py8
1 files changed, 1 insertions, 7 deletions
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)