diff options
author | Julian Eisel <julian@blender.org> | 2020-07-01 18:25:04 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-07-01 18:25:04 +0300 |
commit | 889c4ca9c26d770af02cedef972d65eb173bdb5e (patch) | |
tree | 6f46156146db1b3f09d92c6eaa1f44ba8a584ed4 /source/blender/editors/animation | |
parent | 87df15190210eb84ef52e5dccc2932918f912da5 (diff) | |
parent | 0829cebeb024095c268f190c34daa8ae9a5a224c (diff) |
Merge branch 'asset-uuid--archived' into asset-engine--archivedasset-engine--archived
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 9 | ||||
-rw-r--r-- | source/blender/editors/animation/time_scrub_ui.c | 44 |
2 files changed, 46 insertions, 7 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index bd83bdae31b..9564b662b12 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -3414,12 +3414,13 @@ static size_t animdata_filter_remove_duplis(ListBase *anim_data) /* ----------- Public API --------------- */ -/* This function filters the active data source to leave only animation channels suitable for +/** + * This function filters the active data source to leave only animation channels suitable for * usage by the caller. It will return the length of the list * - * *anim_data: is a pointer to a ListBase, to which the filtered animation channels - * will be placed for use. - * filter_mode: how should the data be filtered - bitmapping accessed flags + * \param anim_data: Is a pointer to a #ListBase, + * to which the filtered animation channels will be placed for use. + * \param filter_mode: how should the data be filtered - bit-mapping accessed flags. */ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, diff --git a/source/blender/editors/animation/time_scrub_ui.c b/source/blender/editors/animation/time_scrub_ui.c index 863f433c778..edc36326c57 100644 --- a/source/blender/editors/animation/time_scrub_ui.c +++ b/source/blender/editors/animation/time_scrub_ui.c @@ -92,7 +92,9 @@ static void draw_current_frame(const Scene *scene, bool display_seconds, const View2D *v2d, const rcti *scrub_region_rect, - int current_frame) + int current_frame, + float sub_frame, + bool draw_line) { const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; int frame_x = UI_view2d_view_to_region_x(v2d, current_frame); @@ -106,6 +108,22 @@ static void draw_current_frame(const Scene *scene, float bg_color[4]; UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color); + if (draw_line) { + /* Draw vertical line to from the bottom of the current frame box to the bottom of the screen. + */ + const float subframe_x = UI_view2d_view_to_region_x(v2d, current_frame + sub_frame); + GPUVertFormat *format = immVertexFormat(); + uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); + immUniformThemeColor(TH_CFRAME); + immRectf(pos, + subframe_x - U.pixelsize, + scrub_region_rect->ymax - box_padding, + subframe_x + U.pixelsize, + 0.0f); + immUnbindProgram(); + } + UI_draw_roundbox_corner_set(UI_CNR_ALL); UI_draw_roundbox_3fv_alpha(true, @@ -135,6 +153,28 @@ static void draw_current_frame(const Scene *scene, text_color); } +void ED_time_scrub_draw_current_frame(const ARegion *region, + const Scene *scene, + bool display_seconds, + bool draw_line) +{ + const View2D *v2d = ®ion->v2d; + GPU_matrix_push_projection(); + wmOrtho2_region_pixelspace(region); + + rcti scrub_region_rect; + get_time_scrub_region_rect(region, &scrub_region_rect); + + draw_current_frame(scene, + display_seconds, + v2d, + &scrub_region_rect, + scene->r.cfra, + scene->r.subframe, + draw_line); + GPU_matrix_pop_projection(); +} + void ED_time_scrub_draw(const ARegion *region, const Scene *scene, bool display_seconds, @@ -161,8 +201,6 @@ void ED_time_scrub_draw(const ARegion *region, region, v2d, &numbers_rect, scene, display_seconds, TH_TEXT); } - draw_current_frame(scene, display_seconds, v2d, &scrub_region_rect, scene->r.cfra); - GPU_matrix_pop_projection(); } |