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_channels_edit.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_channels_edit.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_channels_edit.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_channels_edit.c b/source/blender/editors/space_sequencer/sequencer_channels_edit.c new file mode 100644 index 00000000000..5a9189f74a8 --- /dev/null +++ b/source/blender/editors/space_sequencer/sequencer_channels_edit.c @@ -0,0 +1,59 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * Copyright 2022 Blender Foundation. All rights reserved. */ + +/** \file + * \ingroup sequencer + */ + +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_windowmanager_types.h" + +#include "BKE_context.h" + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" + +#include "ED_screen.h" + +#include "UI_view2d.h" + +#include "SEQ_channels.h" +#include "SEQ_sequencer.h" +#include "SEQ_time.h" + +#include "WM_api.h" + +#include "RNA_define.h" +#include "RNA_enum_types.h" + +/* Own include. */ +#include "sequencer_intern.h" + +static int sequencer_rename_channel_invoke(bContext *C, + wmOperator *UNUSED(op), + const wmEvent *event) +{ + SeqChannelDrawContext context; + SpaceSeq *sseq = CTX_wm_space_seq(C); + channel_draw_context_init(C, CTX_wm_region(C), &context); + float mouse_y = UI_view2d_region_to_view_y(context.timeline_region_v2d, event->mval[1]); + + sseq->runtime.rename_channel_index = mouse_y; + WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, CTX_data_scene(C)); + return OPERATOR_FINISHED; +} + +void SEQUENCER_OT_rename_channel(struct wmOperatorType *ot) +{ + /* Identifiers. */ + ot->name = "Rename Channel"; + ot->idname = "SEQUENCER_OT_rename_channel"; + + /* Api callbacks. */ + ot->invoke = sequencer_rename_channel_invoke; + ot->poll = sequencer_edit_poll; + + /* Flags. */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL; +} |