[Bf-blender-cvs] [550835a73b0] soc-2020-outliner: Outliner: Draw hierarchy lines for child objects

Nathan Craddock noreply at git.blender.org
Tue Aug 18 05:06:17 CEST 2020


Commit: 550835a73b0574965c55cf9a83be978d58b5c8c7
Author: Nathan Craddock
Date:   Mon Aug 17 20:53:28 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rB550835a73b0574965c55cf9a83be978d58b5c8c7

Outliner: Draw hierarchy lines for child objects

Reintroduce the drawing of hierarchy lines for child objects.

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

M	source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 4d9bc5fa077..5bc63e4648e 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3428,6 +3428,17 @@ static void outliner_draw_tree_element(bContext *C,
 
 #endif /* if 0 */
 
+static bool subtree_contains_object(ListBase *lb)
+{
+  LISTBASE_FOREACH (TreeElement *, te, lb) {
+    TreeStoreElem *tselem = TREESTORE(te);
+    if (tselem->type == 0 && te->idcode == ID_OB) {
+      return true;
+    }
+  }
+  return false;
+}
+
 static void outliner_draw_hierarchy_lines_recursive(uint pos,
                                                     SpaceOutliner *space_outliner,
                                                     ListBase *lb,
@@ -3438,7 +3449,7 @@ static void outliner_draw_hierarchy_lines_recursive(uint pos,
 {
   bTheme *btheme = UI_GetTheme();
   int y = *starty;
-  short color;
+  short color = 0;
 
   /* Small vertical padding */
   const short line_padding = UI_UNIT_Y / 4.0f;
@@ -3460,6 +3471,12 @@ static void outliner_draw_hierarchy_lines_recursive(uint pos,
 
         y = *starty;
       }
+      else if (tselem->type == 0 && te->idcode == ID_OB) {
+        if (subtree_contains_object(&te->subtree)) {
+          draw_hierarchy_line = true;
+          y = *starty;
+        }
+      }
 
       outliner_draw_hierarchy_lines_recursive(
           pos, space_outliner, &te->subtree, startx + UI_UNIT_X, col, draw_grayed_out, starty);



More information about the Bf-blender-cvs mailing list