diff options
author | FĂ©lix <Miadim> | 2021-03-20 01:55:39 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-03-20 03:40:53 +0300 |
commit | bfad8deb0be0d014b5e05c7e1af564acb3d494d1 (patch) | |
tree | e035210f0f0d4c3cd1a19870ea5d1183aa8ae825 /source/blender/sequencer/intern/strip_add.c | |
parent | 4158405c0b9d32dd0c6cc1844bc06561b8513766 (diff) |
VSE: Add new_meta RNA API function
This function can be used to create empty meta strip, which is not
straightforward when using operators. Very useful for import/export
scripts.
Reviewed By: ISS
Differential Revision: https://developer.blender.org/D10661
Diffstat (limited to 'source/blender/sequencer/intern/strip_add.c')
-rw-r--r-- | source/blender/sequencer/intern/strip_add.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/sequencer/intern/strip_add.c b/source/blender/sequencer/intern/strip_add.c index 54e71ff0698..aab522da659 100644 --- a/source/blender/sequencer/intern/strip_add.c +++ b/source/blender/sequencer/intern/strip_add.c @@ -413,6 +413,32 @@ Sequence *SEQ_add_sound_strip(Main *UNUSED(bmain), #endif // WITH_AUDASPACE /** + * Add meta strip. + * + * \param scene: Scene where strips will be added + * \param seqbase: ListBase where strips will be added + * \param load_data: SeqLoadData with information necessary to create strip + * \return created strip + */ + +Sequence *SEQ_add_meta_strip(Scene *scene, ListBase *seqbase, SeqLoadData *load_data) +{ + /* Allocate sequence. */ + Sequence *seqm = SEQ_sequence_alloc( + seqbase, load_data->start_frame, load_data->channel, SEQ_TYPE_META); + + /* Set name. */ + seq_add_set_name(seqm, load_data); + + /* Set frames start and length. */ + seqm->start = load_data->start_frame; + seqm->len = 1; + SEQ_time_update_sequence(scene, seqm); + + return seqm; +} + +/** * Add movie strip. * * \param main: Main reference |