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
committerJulian Eisel <julian@blender.org>2022-03-24 20:38:21 +0300
commita6214ce7acb64f72774405502ec65ae779926694 (patch)
tree0a5bf902cfb6d97ad9030503f713d7f0dd37419e
parent511dfb774382f34275bc0928eb65a1e24a9483f4 (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.
-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;
}