[Bf-blender-cvs] [7f3febf4c0d] master: Fix (unreported): Outliner Data API tree subtree expansion

Nathan Craddock noreply at git.blender.org
Thu Aug 27 05:38:26 CEST 2020


Commit: 7f3febf4c0d0d2aac2248dbc7c5782a6682ac79d
Author: Nathan Craddock
Date:   Wed Aug 26 21:29:45 2020 -0600
Branches: master
https://developer.blender.org/rB7f3febf4c0d0d2aac2248dbc7c5782a6682ac79d

Fix (unreported): Outliner Data API tree subtree expansion

The changes in rB70151e41dc02 broke subtree expansion in the Data API
display mode because the closed subtrees are empty lists. Move the empty
subtree check from `outliner_item_openclose` to the walk navigation
code to prevent the issue.

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

M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_select.c

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

diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 99eb9a04c0e..8567dd4da13 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -152,11 +152,8 @@ void OUTLINER_OT_highlight_update(wmOperatorType *ot)
 /* Open or close a tree element, optionally toggling all children recursively */
 void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all)
 {
-  if (BLI_listbase_is_empty(&te->subtree)) {
-    return;
-  }
-
   TreeStoreElem *tselem = TREESTORE(te);
+
   if (open) {
     tselem->flag &= ~TSE_CLOSED;
   }
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 28f7fc70618..3c7e4506e5d 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1661,7 +1661,10 @@ static TreeElement *outliner_walk_right(SpaceOutliner *space_outliner,
   if (!toggle_all && TSELEM_OPEN(tselem, space_outliner) && !BLI_listbase_is_empty(&te->subtree)) {
     te = te->subtree.first;
   }
-  else {
+  /* Prevent opening leaf elements in the tree.
+   * This cannot be done in `outliner_item_openclose` because the Data API display mode subtrees
+   * are empty unless expanded. */
+  else if (!BLI_listbase_is_empty(&te->subtree)) {
     outliner_item_openclose(te, true, toggle_all);
   }



More information about the Bf-blender-cvs mailing list