Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-07-29 12:35:48 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-07-29 12:38:43 +0300
commit0491052a9697a706b4cd14a1f478180ad6fb8c75 (patch)
tree2eab3623c03c0b678c143c748387aa314ea70c82 /source/blender/editors/space_sequencer
parent5c9979ff0324d9bc26092037899b24ad69f1c34f (diff)
VSE: Change grid line drawing
Add overlay option to disable grid drawing. Reuse drawing code from other editors (timeline editor) Add argument `display_minor_lines` to function `UI_view2d_draw_lines_x__discrete_frames_or_seconds` This way minor line drawing can be disabled and so it doesn't cause too much visual noise. Also spacing seems to be too fine, so VSE uses 3x what is defined in preferences. Reviewed By: fsiddi, Severin Differential Revision: https://developer.blender.org/D11790
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c9
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index a2652d88ebf..3f8dea8b533 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1981,7 +1981,7 @@ static void draw_seq_backdrop(View2D *v2d)
/* Lines separating the horizontal bands. */
i = max_ii(1, ((int)v2d->cur.ymin) - 1);
int line_len = (int)v2d->cur.ymax - i + 1;
- immUniformThemeColor(TH_GRID);
+ immUniformThemeColorShade(TH_GRID, 10);
immBegin(GPU_PRIM_LINES, line_len * 2);
while (line_len--) {
immVertex2f(pos, v2d->cur.xmax, i);
@@ -2419,7 +2419,12 @@ void draw_timeline_seq(const bContext *C, ARegion *region)
/* Get timeline bound-box, needed for the scroll-bars. */
SEQ_timeline_boundbox(scene, SEQ_active_seqbase_get(ed), &v2d->tot);
draw_seq_backdrop(v2d);
- UI_view2d_constant_grid_draw(v2d, FPS);
+ if ((sseq->flag & SEQ_SHOW_STRIP_OVERLAY) && (sseq->flag & SEQ_SHOW_GRID)) {
+ U.v2d_min_gridsize *= 3;
+ UI_view2d_draw_lines_x__discrete_frames_or_seconds(
+ v2d, scene, (sseq->flag & SEQ_DRAWFRAMES) == 0, false);
+ U.v2d_min_gridsize /= 3;
+ }
/* Only draw backdrop in timeline view. */
if (sseq->view == SEQ_VIEW_SEQUENCE && sseq->draw_flag & SEQ_DRAW_BACKDROP) {
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index cf26d1e3243..6de95f0995a 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -100,7 +100,7 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
sseq->mainb = SEQ_DRAW_IMG_IMBUF;
sseq->flag = SEQ_SHOW_GPENCIL | SEQ_USE_ALPHA | SEQ_SHOW_MARKERS | SEQ_SHOW_FCURVES |
SEQ_ZOOM_TO_FIT | SEQ_SHOW_STRIP_OVERLAY | SEQ_SHOW_STRIP_NAME |
- SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_DURATION;
+ SEQ_SHOW_STRIP_SOURCE | SEQ_SHOW_STRIP_DURATION | SEQ_SHOW_GRID;
/* Tool header. */
region = MEM_callocN(sizeof(ARegion), "tool header for sequencer");