From 0adad30e3f5b914d0a101ba6efb07f3fd2d8669e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 22 Jul 2011 11:20:14 +0000 Subject: [PATCH] Bugfix [#27984] CTRL+T doesn't work in Video Sequencer properly Time-scale drawing wasn't respecting the time unit setting. While working on this, I tried to tweak the grid drawing to a more common setting. It's hardcoded to show lines at every 25 px = once every 25 frames, which is only really fine when FPS=25. Anyways, this works fine enough for the sequencer for now in general usage. --- release/scripts/startup/bl_ui/space_sequencer.py | 6 +++++- .../blender/editors/space_sequencer/sequencer_draw.c | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 6a2f2f3a301..fd1b9dc080b 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -114,7 +114,11 @@ class SEQUENCER_MT_view(bpy.types.Menu): layout.operator("sequencer.view_selected") - layout.prop(st, "show_frames") + if st.show_frames: + layout.operator("anim.time_toggle", text="Show Seconds") + else: + layout.operator("anim.time_toggle", text="Show Frames") + layout.prop(st, "show_frame_indicator") if st.display_mode == 'IMAGE': layout.prop(st, "show_safe_margin") diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 1ed262c3e23..42d52536870 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1024,8 +1024,8 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) SpaceSeq *sseq= CTX_wm_space_seq(C); View2D *v2d= &ar->v2d; View2DScrollers *scrollers; + short unit=0, flag=0; float col[3]; - int flag=0; /* clear and setup matrix */ UI_GetThemeColor3fv(TH_BACK, col); @@ -1047,9 +1047,10 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) /* draw backdrop */ draw_seq_backdrop(v2d); - /* regular grid-pattern over the rest of the view (i.e. frame grid lines) */ + /* regular grid-pattern over the rest of the view (i.e. 25-frame grid lines) */ + // NOTE: the gridlines are currently spaced every 25 frames, which is only fine for 25 fps, but maybe not for 30... UI_view2d_constant_grid_draw(v2d); - + seq_draw_sfra_efra(scene, v2d); /* sequence strips (if there is data available to be drawn) */ @@ -1092,7 +1093,8 @@ void draw_timeline_seq(const bContext *C, ARegion *ar) UI_view2d_view_restore(C); /* scrollers */ - scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_SECONDSSEQ, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP); + unit= (sseq->flag & SEQ_DRAWFRAMES)? V2D_UNIT_FRAMES : V2D_UNIT_SECONDSSEQ; + scrollers= UI_view2d_scrollers_calc(C, v2d, unit, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP); UI_view2d_scrollers_draw(C, v2d, scrollers); UI_view2d_scrollers_free(scrollers); }