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
This commit is contained in:
Pratik Borhade 2023-10-17 12:39:01 +02:00 committed by Pratik Borhade
parent e21dfb4c42
commit 8867cfc563
1 changed files with 9 additions and 0 deletions

View File

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