Merge branch 'blender-v4.5-release'

This commit is contained in:
Harley Acheson
2025-07-07 17:00:19 -07:00
5 changed files with 15 additions and 9 deletions

View File

@@ -514,7 +514,7 @@ static void draw_marker(const uiFontStyle *fstyle,
draw_marker_name(text_color, fstyle, marker, xpos, xmax, name_y);
}
static void draw_markers_background(const rctf *rect)
static void draw_markers_background(const rctf *rect, const float alpha)
{
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", blender::gpu::VertAttrType::SFLOAT_32_32);
@@ -522,6 +522,7 @@ static void draw_markers_background(const rctf *rect)
uchar shade[4];
UI_GetThemeColor4ubv(TH_TIME_SCRUB_BACKGROUND, shade);
shade[3] *= alpha;
immUniformColor4ubv(shade);
@@ -584,7 +585,10 @@ void ED_markers_draw(const bContext *C, int flag)
rctf markers_region_rect;
get_marker_region_rect(v2d, &markers_region_rect);
draw_markers_background(&markers_region_rect);
const float fade = BLI_rctf_size_y(&markers_region_rect) + UI_ANIM_MINY;
const float dist = std::min(region->winy - fade, fade);
const float alpha = std::min(dist / fade, 1.0f);
draw_markers_background(&markers_region_rect, alpha);
/* no time correction for framelen! space is drawn with old values */
float xscale, dummy;

View File

@@ -219,7 +219,7 @@ static void action_main_region_draw(const bContext *C, ARegion *region)
UI_view2d_view_ortho(v2d);
/* clear and setup matrix */
UI_ThemeClearColor(region->winy > min_height ? TH_BACK : TH_TIME_SCRUB_BACKGROUND);
UI_ThemeClearColor(TH_BACK);
UI_view2d_view_ortho(v2d);
@@ -254,7 +254,7 @@ static void action_main_region_draw(const bContext *C, ARegion *region)
marker_flag = ((ac.markers && (ac.markers != &ac.scene->markers)) ? DRAW_MARKERS_LOCAL : 0) |
DRAW_MARKERS_MARGIN;
if (saction->flag & SACTION_SHOW_MARKERS) {
if (saction->flag & SACTION_SHOW_MARKERS && region->winy > (UI_ANIM_MINY + UI_MARKER_MARGIN_Y)) {
ED_markers_draw(C, marker_flag);
}

View File

@@ -227,7 +227,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
const int min_height = UI_ANIM_MINY;
/* clear and setup matrix */
UI_ThemeClearColor(region->winy > min_height ? TH_BACK : TH_TIME_SCRUB_BACKGROUND);
UI_ThemeClearColor(TH_BACK);
UI_view2d_view_ortho(v2d);
@@ -315,7 +315,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *region)
if (sipo->mode != SIPO_MODE_DRIVERS) {
UI_view2d_view_orthoSpecial(region, v2d, true);
int marker_draw_flag = DRAW_MARKERS_MARGIN;
if (sipo->flag & SIPO_SHOW_MARKERS) {
if (sipo->flag & SIPO_SHOW_MARKERS && region->winy > (UI_ANIM_MINY + UI_MARKER_MARGIN_Y)) {
ED_markers_draw(C, marker_draw_flag);
}
}

View File

@@ -258,7 +258,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *region)
const int min_height = UI_ANIM_MINY;
/* clear and setup matrix */
UI_ThemeClearColor(region->winy > min_height ? TH_BACK : TH_TIME_SCRUB_BACKGROUND);
UI_ThemeClearColor(TH_BACK);
UI_view2d_view_ortho(v2d);
@@ -287,7 +287,7 @@ static void nla_main_region_draw(const bContext *C, ARegion *region)
/* markers */
UI_view2d_view_orthoSpecial(region, v2d, true);
int marker_draw_flag = DRAW_MARKERS_MARGIN;
if (snla->flag & SNLA_SHOW_MARKERS) {
if (snla->flag & SNLA_SHOW_MARKERS && region->winy > (UI_ANIM_MINY + UI_MARKER_MARGIN_Y)) {
ED_markers_draw(C, marker_draw_flag);
}

View File

@@ -1871,7 +1871,9 @@ void draw_timeline_seq(const bContext *C, ARegion *region)
draw_timeline_grid(&ctx);
draw_timeline_sfra_efra(&ctx);
draw_seq_strips(&ctx, strips_batch);
draw_timeline_markers(&ctx);
if (region->winy > (UI_ANIM_MINY + UI_MARKER_MARGIN_Y)) {
draw_timeline_markers(&ctx);
}
UI_view2d_view_ortho(ctx.v2d);
ANIM_draw_previewrange(ctx.scene, ctx.v2d, 1);
draw_timeline_gizmos(&ctx);