Bugfix [#27984] CTRL+T doesn't work in Video Sequencer properly
authorJoshua Leung <aligorith@gmail.com>
Fri, 22 Jul 2011 11:20:14 +0000 (11:20 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 22 Jul 2011 11:20:14 +0000 (11:20 +0000)
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
source/blender/editors/space_sequencer/sequencer_draw.c

index 6a2f2f3a301eb9130df483aed513d77678af826d..fd1b9dc080bac643680e14709e33b0281d32e694 100644 (file)
@@ -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")
index 1ed262c3e2310c9af9cae783f136c39d5900e935..42d52536870db6875cfdf8c42143f276f9b945c2 100644 (file)
@@ -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);
 }