From 8867cfc563bd8432aafb4e28cebb0f67a4b014ca Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Tue, 17 Oct 2023 12:39:01 +0200 Subject: [PATCH] Fix #113778: Skip unlinking a linked collection if parent is linked Similar to 197f3d75d1, do not unlink a linked collection from a linked parent Pull Request: https://projects.blender.org/blender/blender/pulls/113805 --- source/blender/editors/space_outliner/outliner_tools.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 179a71f2985..8d654b80c73 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -393,6 +393,15 @@ static void unlink_collection_fn(bContext *C, return; } + if (tsep && (ID_IS_LINKED(tsep->id) || ID_IS_OVERRIDE_LIBRARY(tsep->id))) { + BKE_reportf(reports, + RPT_WARNING, + "Cannot unlink collection '%s' parented to another linked collection '%s'", + collection->id.name + 2, + tsep->id->name + 2); + return; + } + if (tsep) { if (GS(tsep->id->name) == ID_OB) { Object *ob = (Object *)tsep->id;