From fa9bd044833ba70c64356b1803abcb594a756a62 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 16 Mar 2017 16:47:56 +0100 Subject: [PATCH] Fix outliner contextual menu allowing to delete indirect libraries. There is no way currently to prevent the option from showing in menu, so instead report a warning to user (and curse again current nightmarish system of operation in outliner...). Reported by @sergey, thanks. --- source/blender/editors/space_outliner/outliner_edit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 345ac353c11..8c3b9a55089 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -309,9 +309,12 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto ID *id = tselem->id; BLI_assert(te->idcode != 0 && id != NULL); - BLI_assert(te->idcode != ID_LI || ((Library *)id)->parent == NULL); UNUSED_VARS_NDEBUG(te); + if (te->idcode == ID_LI && ((Library *)id)->parent != NULL) { + BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked library '%s'", id->name); + return; + } if (id->tag & LIB_TAG_INDIRECT) { BKE_reportf(reports, RPT_WARNING, "Cannot delete indirectly linked id '%s'", id->name); return;