diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-03 20:56:37 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-12-05 03:58:46 +0300 |
commit | 887a602448286fe57b77046001a72d488415b1b8 (patch) | |
tree | 3992d2ef94c5319dfe4644b0b481c45056437086 /source/blender/editors/space_outliner/outliner_tree.c | |
parent | 48acf15f9856d6ffcd29cdd8b3a64dd9eb983cd0 (diff) |
Cleanup: Finish porting outliner tree building to C++
No functional changes. This is a few minor cleanups to the remaining C
code for building the outliner tree after parts have been moved to C++.
Differential Revision: https://developer.blender.org/D9741
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_tree.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 52f91781967..37f748692f9 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -2054,7 +2054,6 @@ static void outliner_filter_tree(SpaceOutliner *space_outliner, ViewLayer *view_ /* Main Tree Building API */ /* Main entry point for building the tree data-structure that the outliner represents. */ -/* TODO: split each mode into its own function? */ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, @@ -2091,40 +2090,13 @@ void outliner_build_tree(Main *mainvar, space_outliner->runtime->tree_display = outliner_tree_display_create(space_outliner->outlinevis, space_outliner); - if (space_outliner->runtime->tree_display) { - TreeSourceData source_data = {.bmain = mainvar, .scene = scene, .view_layer = view_layer}; - space_outliner->tree = outliner_tree_display_build_tree(space_outliner->runtime->tree_display, - &source_data); - } - if (space_outliner->runtime->tree_display) { - /* Skip if there's a tree-display that's responsible for adding all elements. */ - } - /* options */ - else if (space_outliner->outlinevis == SO_LIBRARIES) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } - else if (space_outliner->outlinevis == SO_SCENES) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } - else if (space_outliner->outlinevis == SO_SEQUENCE) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } - else if (space_outliner->outlinevis == SO_DATA_API) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } - else if (space_outliner->outlinevis == SO_ID_ORPHANS) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } - else if (space_outliner->outlinevis == SO_VIEW_LAYER) { - /* Ported to new tree-display, should be built there already. */ - BLI_assert(false); - } + /* All tree displays should be created as sub-classes of AbstractTreeDisplay. */ + BLI_assert(space_outliner->runtime->tree_display != NULL); + + TreeSourceData source_data = {.bmain = mainvar, .scene = scene, .view_layer = view_layer}; + space_outliner->tree = outliner_tree_display_build_tree(space_outliner->runtime->tree_display, + &source_data); if ((space_outliner->flag & SO_SKIP_SORT_ALPHA) == 0) { outliner_sort(&space_outliner->tree); |