diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-04-04 13:52:48 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2022-04-11 01:31:57 +0300 |
commit | 68f5c80ee85177825cd37a13d5d40a41ebf96009 (patch) | |
tree | 4dff43bbbfe153ffe173b50bebdaf9b5eaf5dc53 /source/blender/editors/space_sequencer/sequencer_select.c | |
parent | f89b7332c8bee71d0c651d225d7baacb7ca9fdbd (diff) |
VSE: Add channel headers
This patch adds channel region to VSE timeline area for drawing channel
headers. It is synchronizedwith timeline region. 3 basic features are
implemented - channel visibility, locking and name.
Channel data is stored in `SeqTimelineChannel` which can be top-level
owned by `Editing`, or it is owned by meta strip to support nesting.
Strip properties are completely independent and channel properties are
applied on top of particular strip property, thus overriding it.
Implementation is separate from channel regions in other editors. This
is mainly because style and topology is quite different in VSE. But
also code seems to be much more readable this way.
Currently channels use functions similar to VSE timeline to draw
background to provide illusion of transparency, but only for background
and sfra/efra regions.
Great portion of this patch is change from using strip visibility and
lock status to include channel state - this is facilitated by functions
`SEQ_transform_is_locked` and `SEQ_render_is_muted`
Originally this included changes in D14263, but patch was split for
easier review.
Reviewed By: fsiddi, Severin
Differential Revision: https://developer.blender.org/D13836
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_select.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index bd6350960f1..66df1309d54 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -25,6 +25,7 @@ #include "RNA_define.h" +#include "SEQ_channels.h" #include "SEQ_iterator.h" #include "SEQ_select.h" #include "SEQ_sequencer.h" @@ -51,11 +52,13 @@ SeqCollection *all_strips_from_context(bContext *C) { Scene *scene = CTX_data_scene(C); - ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene)); + Editing *ed = SEQ_editing_get(scene); + ListBase *seqbase = SEQ_active_seqbase_get(ed); + ListBase *channels = SEQ_channels_displayed_get(ed); const bool is_preview = sequencer_view_has_preview_poll(C); if (is_preview) { - return SEQ_query_rendered_strips(seqbase, scene->r.cfra, 0); + return SEQ_query_rendered_strips(channels, seqbase, scene->r.cfra, 0); } return SEQ_query_all_strips(seqbase); @@ -64,11 +67,13 @@ SeqCollection *all_strips_from_context(bContext *C) SeqCollection *selected_strips_from_context(bContext *C) { Scene *scene = CTX_data_scene(C); - ListBase *seqbase = SEQ_active_seqbase_get(SEQ_editing_get(scene)); + Editing *ed = SEQ_editing_get(scene); + ListBase *seqbase = SEQ_active_seqbase_get(ed); + ListBase *channels = SEQ_channels_displayed_get(ed); const bool is_preview = sequencer_view_has_preview_poll(C); if (is_preview) { - SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, 0); + SeqCollection *strips = SEQ_query_rendered_strips(channels, seqbase, scene->r.cfra, 0); SEQ_filter_selected_strips(strips); return strips; } @@ -709,6 +714,7 @@ static Sequence *seq_select_seq_from_preview( Scene *scene = CTX_data_scene(C); Editing *ed = SEQ_editing_get(scene); ListBase *seqbase = SEQ_active_seqbase_get(ed); + ListBase *channels = SEQ_channels_displayed_get(ed); SpaceSeq *sseq = CTX_wm_space_seq(C); View2D *v2d = UI_view2d_fromcontext(C); @@ -718,7 +724,8 @@ static Sequence *seq_select_seq_from_preview( /* Always update the coordinates (check extended after). */ const bool use_cycle = (!WM_cursor_test_motion_and_update(mval) || extend || toggle); - SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, sseq->chanshown); + SeqCollection *strips = SEQ_query_rendered_strips( + channels, seqbase, scene->r.cfra, sseq->chanshown); /* Allow strips this far from the closest center to be included. * This allows cycling over center points which are near enough @@ -1574,9 +1581,11 @@ static void seq_box_select_seq_from_preview(const bContext *C, rctf *rect, const Scene *scene = CTX_data_scene(C); Editing *ed = SEQ_editing_get(scene); ListBase *seqbase = SEQ_active_seqbase_get(ed); + ListBase *channels = SEQ_channels_displayed_get(ed); SpaceSeq *sseq = CTX_wm_space_seq(C); - SeqCollection *strips = SEQ_query_rendered_strips(seqbase, scene->r.cfra, sseq->chanshown); + SeqCollection *strips = SEQ_query_rendered_strips( + channels, seqbase, scene->r.cfra, sseq->chanshown); Sequence *seq; SEQ_ITERATOR_FOREACH (seq, strips) { if (!seq_box_select_rect_image_isect(scene, seq, rect)) { |