Collection Manager: Improve SetCollection Operator. Task: T69577
Reduces complexity when setting objects' collections.
This commit is contained in:
parent
42d5e009be
commit
dc0def220d
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue