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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user