Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2020-08-18 05:53:28 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-08-18 05:53:28 +0300
commit550835a73b0574965c55cf9a83be978d58b5c8c7 (patch)
tree7a738b4c956d30f8061d34ef1c57755cb0226f41 /source/blender/editors/space_outliner/outliner_draw.c
parent2cf264009e6d8e09c98481b4fd89724262f31a86 (diff)
Outliner: Draw hierarchy lines for child objects
Reintroduce the drawing of hierarchy lines for child objects.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_draw.c')
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c19
1 files changed, 18 insertions, 1 deletions
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);