From bd437ba3057004d3de48ed1096612d10f79e1e2d Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 21 Feb 2023 19:03:01 +0100 Subject: [PATCH 1/2] Animation: Draw channels backdrop color in Timeline Editor The backdrop color for channels such as Summary and its hierarchy was drawn on all animation editors but the Timeline. --- source/blender/editors/space_action/action_draw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 47f82ffe999..8938a77b794 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -232,7 +232,11 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region sel = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT); } - if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_SHAPEKEY)) { + if (ELEM(ac->datatype, + ANIMCONT_ACTION, + ANIMCONT_DOPESHEET, + ANIMCONT_SHAPEKEY, + ANIMCONT_TIMELINE)) { switch (ale->type) { case ANIMTYPE_SUMMARY: { /* reddish color from NLA */ -- 2.30.2 From f6bd0e9c61aef56b0474d207ca9e4d3b8ae70069 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Fri, 24 Feb 2023 15:40:16 +0100 Subject: [PATCH 2/2] Animation: Draw summary backdrop only when expanded Reduce visual clutter by drawing the summary channel backdrop color only when it's expanded. This way, the default workspace (Layout) doesn't show the backdrop on startup, while the Animation workspace does. Suggested by Brecht in #105041 --- source/blender/editors/space_action/action_draw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 8938a77b794..1e545393899 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -218,6 +218,7 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region const float channel_step = ANIM_UI_get_channel_step(); for (ale = anim_data.first; ale; ale = ale->next, ymax -= channel_step) { const float ymin = ymax - ANIM_UI_get_channel_height(); + const bool is_expanded = ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_EXPAND) != 0; /* check if visible */ if (IN_RANGE(ymin, v2d->cur.ymin, v2d->cur.ymax) || @@ -298,8 +299,11 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region } } - /* draw region twice: firstly backdrop, then the current range */ - immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); + /* Don't show backdrop color when summary is collapsed. */ + if (ale->type != ANIMTYPE_SUMMARY || is_expanded) { + /* draw region twice: firstly backdrop, then the current range */ + immRectf(pos, v2d->cur.xmin, ymin, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymax); + } } else if (ac->datatype == ANIMCONT_GPENCIL) { uchar *color; -- 2.30.2