diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-06-20 17:52:58 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-06-20 17:52:58 +0400 |
commit | e85a39b7473b3f08aa5517f761da4c0901301796 (patch) | |
tree | d70fec4507edde2cded40b942d6c1a9cfd9d60b3 /source/blender | |
parent | f35264706a403a666e7f3077c4b807bd1aaa3765 (diff) |
Sequencer: fix names when adding several video (or audio) files at once (all strips were getting the same, annoying ;) ).
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_add.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9b276912087..68fac399c51 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -4171,6 +4171,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad BKE_sequence_calc_disp(scene, seq); + if (seq_load->name[0] == '\0') + BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name)); if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) { int start_frame_back = seq_load->start_frame; @@ -4182,9 +4184,6 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad seq_load->channel--; } - if (seq_load->name[0] == '\0') - BLI_strncpy(seq_load->name, se->name, sizeof(seq_load->name)); - /* can be NULL */ seq_load_apply(scene, seq, seq_load); diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 571779a7524..65199ee9c3d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -562,10 +562,14 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad RNA_string_get(&itemptr, "name", file_only); BLI_join_dirfile(seq_load.path, sizeof(seq_load.path), dir_only, file_only); + /* Set seq_load.name, else all video/audio files get the same name! ugly! */ + BLI_strncpy(seq_load.name, file_only, sizeof(seq_load.name)); + seq = seq_load_func(C, ed->seqbasep, &seq_load); if (seq) { if (overlap == FALSE) { - if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene); + if (BKE_sequence_test_overlap(ed->seqbasep, seq)) + BKE_sequence_base_shuffle(ed->seqbasep, seq, scene); } } } |