[Bf-extensions-cvs] [0657e99e] master: Collection Manager: Fix remove issue. Task: T69577

Ryan Inch noreply at git.blender.org
Sat Jul 18 06:51:54 CEST 2020


Commit: 0657e99e1f4ff01118591d19ffc740694869ba96
Author: Ryan Inch
Date:   Sat Jul 18 00:48:13 2020 -0400
Branches: master
https://developer.blender.org/rBA0657e99e1f4ff01118591d19ffc740694869ba96

Collection Manager: Fix remove issue. Task: T69577

Fix error when removing a collection with a child that is already
linked to the parent collection.

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

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 e8b8f25c..1b33c549 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": (2, 9, 3),
+    "version": (2, 9, 4),
     "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 54f9596b..77882c97 100644
--- a/object_collection_manager/operators.py
+++ b/object_collection_manager/operators.py
@@ -897,7 +897,8 @@ class CMRemoveCollectionOperator(Operator):
 
             # link any subcollections of the to be deleted collection to it's parent
             for subcollection in collection.children:
-                parent_collection.children.link(subcollection)
+                if not subcollection.name in parent_collection.children:
+                    parent_collection.children.link(subcollection)
 
             # apply the stored view layer RTOs to the newly linked collections and their
             # children



More information about the Bf-extensions-cvs mailing list