diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-08 11:55:30 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-08-08 11:57:40 +0300 |
commit | b74612e034020bd5c5e38f8f122555799872ffa2 (patch) | |
tree | 5753bad14015ace0cca832f5122ac1087660f471 /source/blender/editors | |
parent | e4b68befa2eb26df7114507f41102a60b5d38fe7 (diff) |
Fix T56251: Outliner crash on selecting nested.
We need a valid tree here, undo step will make it invalid...
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_collections.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |