From d0002524026d9a4683fb513036cd023449bbc414 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 24 Mar 2022 18:38:21 +0100 Subject: 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. --- .../editors/space_outliner/tree/tree_display_override_library.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/editors/space_outliner') 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; } -- cgit v1.2.3