[Bf-blender-cvs] [a6214ce7acb] master: Outliner: Don't show empty base elements in the library overrides mode

Julian Eisel noreply at git.blender.org
Thu Mar 24 18:41:03 CET 2022


Commit: a6214ce7acb64f72774405502ec65ae779926694
Author: Julian Eisel
Date:   Thu Mar 24 18:38:21 2022 +0100
Branches: master
https://developer.blender.org/rBa6214ce7acb64f72774405502ec65ae779926694

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.

===================================================================

M	source/blender/editors/space_outliner/tree/tree_display_override_library.cc

===================================================================

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;
 }



More information about the Bf-blender-cvs mailing list