Collection Manager: Improve SetCollection Operator. Task: T69577

Reduces complexity when setting objects' collections.
This commit is contained in:
Ryan Inch 2020-01-06 00:58:07 -05:00
parent 42d5e009be
commit dc0def220d
2 changed files with 2 additions and 8 deletions

View File

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

View File

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