Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-03-24 20:38:21 +0300
committerFabian Schempp <fabianschempp@googlemail.com>2022-04-11 01:31:45 +0300
commitd0002524026d9a4683fb513036cd023449bbc414 (patch)
tree649f3a00a16b9a460da462f416d3c7cb3ae988c8 /source/blender/editors/space_outliner
parent21f1ee6346c2fcfc79ce817aaa045fd6ff9cd409 (diff)
Outliner: Don't show empty base elements in the library overrides mode
In the library overrides mode, in some situations there would be empty base elements like "Collections" or "Objects". Don't show them, it's confusing wihout use. Code just failed to consider that case.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/tree/tree_display_override_library.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
index 1af4b8673d3..b5c0a10c834 100644
--- a/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
+++ b/source/blender/editors/space_outliner/tree/tree_display_override_library.cc
@@ -104,6 +104,13 @@ ListBase TreeDisplayOverrideLibrary::add_library_contents(Main &mainvar)
}
}
+ /* Remove ID base elements that turn out to be empty. */
+ LISTBASE_FOREACH_MUTABLE (TreeElement *, te, &tree) {
+ if (BLI_listbase_is_empty(&te->subtree)) {
+ outliner_free_tree_element(te, &tree);
+ }
+ }
+
return tree;
}