[Bf-blender-cvs] [08b79554156] master: Fix T51625: fix impossibility to delete uninstantiated objects from Outliner.

Bastien Montagne noreply at git.blender.org
Mon May 29 12:29:53 CEST 2017


Commit: 08b79554156e81ece766e854fe15e34c7d4a7572
Author: Bastien Montagne
Date:   Mon May 29 12:27:59 2017 +0200
Branches: master
https://developer.blender.org/rB08b79554156e81ece766e854fe15e34c7d4a7572

Fix T51625: fix impossibility to delete uninstantiated objects from Outliner.

The fact that we can end with uninstantiated objects is not expected
currently, but would rather not start chasing all corner cases that may
lead to that situation.

User shall be able to delete uninstantiated objects from Outliner, though!

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 086cc55366b..cdb3df0fae9 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -431,6 +431,13 @@ static void object_delete_cb(
 		tselem->id = NULL;
 #endif
 	}
+	else {
+		/* No base, means object is no more instantiated in any scene.
+		 * Should not happen ideally, but does happens, see T51625.
+		 * Rather than twisting in all kind of ways to address all possible cases leading to that situation, simpler
+		 * to allow deleting such object as a mere generic data-block. */
+		WM_operator_name_call(C, "OUTLINER_OT_id_delete", WM_OP_INVOKE_REGION_WIN, NULL);
+	}
 }
 
 static void id_local_cb(




More information about the Bf-blender-cvs mailing list