[Bf-blender-cvs] [fa9bd04483] master: Fix outliner contextual menu allowing to delete indirect libraries.

Bastien Montagne noreply at git.blender.org
Thu Mar 16 17:06:02 CET 2017


Commit: fa9bd044833ba70c64356b1803abcb594a756a62
Author: Bastien Montagne
Date:   Thu Mar 16 16:47:56 2017 +0100
Branches: master
https://developer.blender.org/rBfa9bd044833ba70c64356b1803abcb594a756a62

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.

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

M	source/blender/editors/space_outliner/outliner_edit.c

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

diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 345ac353c1..8c3b9a5508 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;




More information about the Bf-blender-cvs mailing list