diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-05-18 22:26:47 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-05-18 22:26:47 +0300 |
commit | 8ca9ce09865e6a617d6c2f78f3483ba1fd5d6aef (patch) | |
tree | 371395186f59292cf0d7b94a055da690696336ef /source/blender/editors/space_sequencer/sequencer_draw.c | |
parent | 47dbdf8dd5744bc61f2e16f8d5c5eb4203ce0c48 (diff) |
VSE: Remove still frame offsets
To clarify term still frame: This is portion of strip that displays
static image. This area can exist before or after strip movie content.
Still frames were implemented as strip property, but this was never
displayed in panel. Only way to set still frames was to drag strip
handle with mouse or using python API. This would set either
`seq->*still` or `seq->*ofs` where * stands for `start` or `end`.
When strip had offset, it can't have still frames and vice versa, but
this had to be enforced in RNA functions and everywhere in code where
these fields are set directly. Strip can not have negative offset or
negative number of still frames.
This is not very practical approach and still frames can be simply
implemented as applying negative offset. Merging these offsets would
simplify offset calculations for example in D14962 and could make it
easier to also deprecate usage `seq->*disp` and necessity to call
update functions to recalculate strip boundaries.
For users only functional change is ability to set negative strip offset
using property in side panel.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D14976
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index a561de1ef64..2b01892bbe7 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1109,15 +1109,15 @@ static void draw_seq_background(Scene *scene, } /* Draw background for hold still regions. */ - if (!is_single_image && (seq->startstill || seq->endstill)) { + if (!is_single_image && SEQ_time_has_still_frames(seq)) { UI_GetColorPtrShade3ubv(col, col, -35); immUniformColor4ubv(col); - if (seq->startstill) { + if (SEQ_time_has_left_still_frames(seq)) { const float content_start = min_ff(seq->enddisp, seq->start); immRectf(pos, seq->startdisp, y1, content_start, y2); } - if (seq->endstill) { + if (SEQ_time_has_right_still_frames(seq)) { const float content_end = max_ff(seq->startdisp, seq->start + seq->len); immRectf(pos, content_end, y1, seq->enddisp, y2); } @@ -1336,9 +1336,9 @@ static void draw_seq_strip(const bContext *C, SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG); /* Draw strip body. */ - x1 = (seq->startstill) ? seq->start : seq->startdisp; + x1 = SEQ_time_has_left_still_frames(seq) ? seq->start : seq->startdisp; y1 = seq->machine + SEQ_STRIP_OFSBOTTOM; - x2 = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp; + x2 = SEQ_time_has_right_still_frames(seq) ? (seq->start + seq->len) : seq->enddisp; y2 = seq->machine + SEQ_STRIP_OFSTOP; /* Limit body to strip bounds. Meta strip can end up with content outside of strip range. */ |