[Bf-blender-cvs] [b74612e0340] blender2.8: Fix T56251: Outliner crash on selecting nested.

Bastien Montagne noreply at git.blender.org
Wed Aug 8 10:57:50 CEST 2018


Commit: b74612e034020bd5c5e38f8f122555799872ffa2
Author: Bastien Montagne
Date:   Wed Aug 8 10:55:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb74612e034020bd5c5e38f8f122555799872ffa2

Fix T56251: Outliner crash on selecting nested.

We need a valid tree here, undo step will make it invalid...

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index e480cac2dcc..946d2b019a9 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -138,8 +138,10 @@ static TreeTraversalAction collection_find_selected_to_add(TreeElement *te, void
 static int collection_new_exec(bContext *C, wmOperator *op)
 {
 	SpaceOops *soops = CTX_wm_space_outliner(C);
+	ARegion *ar = CTX_wm_region(C);
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
+	ViewLayer *view_layer = CTX_data_view_layer(C);
 
 	struct CollectionNewData data = {
 		.error = false,
@@ -147,6 +149,8 @@ static int collection_new_exec(bContext *C, wmOperator *op)
 	};
 
 	if (RNA_boolean_get(op->ptr, "nested")) {
+		outliner_build_tree(bmain, scene, view_layer, soops, ar);
+
 		outliner_tree_traverse(soops, &soops->tree, 0, TSE_SELECTED, collection_find_selected_to_add, &data);
 
 		if (data.error) {



More information about the Bf-blender-cvs mailing list