Fix T67181: Only the first added movie strip will have audio below
Find free slot first for sound strips then for movie strips. This patch also fixes issue where all strips were added to channel 2 by default. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8339
This commit is contained in:
parent
189eb2550d
commit
0264f53e30
@ -5592,6 +5592,9 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
|
||||
}
|
||||
}
|
||||
|
||||
if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
|
||||
seq_load->channel++;
|
||||
}
|
||||
seq = BKE_sequence_alloc(seqbasep, seq_load->start_frame, seq_load->channel, SEQ_TYPE_MOVIE);
|
||||
|
||||
/* multiview settings */
|
||||
@ -5648,11 +5651,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
|
||||
if (seq_load->flag & SEQ_LOAD_MOVIE_SOUND) {
|
||||
int start_frame_back = seq_load->start_frame;
|
||||
seq_load->channel--;
|
||||
|
||||
seq_load->seq_sound = BKE_sequencer_add_sound_strip(C, seqbasep, seq_load);
|
||||
|
||||
seq_load->start_frame = start_frame_back;
|
||||
seq_load->channel++;
|
||||
}
|
||||
|
||||
/* can be NULL */
|
||||
|
@ -151,7 +151,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
|
||||
int proximity = INT_MAX;
|
||||
|
||||
if (!ed || !ed->seqbasep) {
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||
@ -165,7 +165,7 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type)
|
||||
if (tgt) {
|
||||
return tgt->machine + 1;
|
||||
}
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, int flag, int type)
|
||||
@ -581,10 +581,10 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
|
||||
|
||||
seq = seq_load_fn(C, ed->seqbasep, &seq_load);
|
||||
if (seq) {
|
||||
sequencer_add_apply_overlap(C, op, seq);
|
||||
if (seq_load.seq_sound) {
|
||||
sequencer_add_apply_overlap(C, op, seq_load.seq_sound);
|
||||
}
|
||||
sequencer_add_apply_overlap(C, op, seq);
|
||||
}
|
||||
}
|
||||
RNA_END;
|
||||
@ -594,10 +594,10 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
|
||||
seq = seq_load_fn(C, ed->seqbasep, &seq_load);
|
||||
|
||||
if (seq) {
|
||||
sequencer_add_apply_overlap(C, op, seq);
|
||||
if (seq_load.seq_sound) {
|
||||
sequencer_add_apply_overlap(C, op, seq_load.seq_sound);
|
||||
}
|
||||
sequencer_add_apply_overlap(C, op, seq);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user