From cd378dac48f81dbe7ec40d19182b791c56a1593d Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 21 Mar 2024 23:28:01 +0100 Subject: [PATCH 1/2] UI: rephrase Compact with Milliseconds user pref for Timecode Style The user preference Timecode Style has a "Compact with Milliseconds" item, but they are not actually milliseconds. For example at 25 fps, frame 42 will be at 00:01+17, or 00:01.68, which is just seconds with the decimal part. Actual milliseconds would be 00:01+680ms or something, which would be cumbersome. This commit rephrases the option to "Compact with Decimals" instead of "Milliseconds". --- source/blender/makesrna/intern/rna_userdef.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index 7149b31be0f..f8f33a832e4 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -4775,9 +4775,9 @@ static void rna_def_userdef_view(BlenderRNA *brna) {USER_TIMECODE_MILLISECONDS, "MILLISECONDS", 0, - "Compact with Milliseconds", - "Similar to SMPTE (Compact), except that instead of frames, " - "milliseconds are shown instead"}, + "Compact with Decimals", + "Similar to SMPTE (Compact), except that the decimal part of the second is shown instead " + "of frames"}, {USER_TIMECODE_SECONDS_ONLY, "SECONDS_ONLY", 0, -- 2.30.2 From 87c19c81435c580819e8787768f0808c9394bc1c Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Thu, 21 Mar 2024 23:32:47 +0100 Subject: [PATCH 2/2] UI: increase timecode precision for decimal style Timecodes in animation editors currently show only one decimal place when the "Compact with Milliseconds" timecode style is selected. This may not be sufficient precision, so increase the precision to 2 places instead. If one animates at 25 fps, each timecode is currently duplicated 2 or 3 times, which makes it hard to distinguish each frame. --- source/blender/editors/animation/time_scrub_ui.cc | 2 +- source/blender/editors/interface/view2d_draw.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/animation/time_scrub_ui.cc b/source/blender/editors/animation/time_scrub_ui.cc index 9e78feda81a..debc9afaca7 100644 --- a/source/blender/editors/animation/time_scrub_ui.cc +++ b/source/blender/editors/animation/time_scrub_ui.cc @@ -65,7 +65,7 @@ static void get_current_time_str( const Scene *scene, bool display_seconds, int frame, char *r_str, uint str_maxncpy) { if (display_seconds) { - BLI_timecode_string_from_time(r_str, str_maxncpy, 0, FRA2TIME(frame), FPS, U.timecode_style); + BLI_timecode_string_from_time(r_str, str_maxncpy, -1, FRA2TIME(frame), FPS, U.timecode_style); } else { BLI_snprintf(r_str, str_maxncpy, "%d", frame); diff --git a/source/blender/editors/interface/view2d_draw.cc b/source/blender/editors/interface/view2d_draw.cc index 1d4e730ab5b..e61015be791 100644 --- a/source/blender/editors/interface/view2d_draw.cc +++ b/source/blender/editors/interface/view2d_draw.cc @@ -416,7 +416,7 @@ static void view_to_string__time( { const Scene *scene = (const Scene *)user_data; - int brevity_level = 0; + int brevity_level = -1; if (U.timecode_style == USER_TIMECODE_MINIMAL && v2d_step >= FPS) { brevity_level = 1; } -- 2.30.2