diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-13 21:29:10 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-02-13 21:29:10 +0400 |
commit | 840ffba82cb6676ddfee85c9ea09b08a1ea1e626 (patch) | |
tree | 451babacb71a2fb5ef8066fe09991824323349dc /source/blender/editors/space_sequencer | |
parent | 32c4ade29c98d82dc7f8b9c158236dbea78220b6 (diff) |
Fixed copy-paste of sound strips in sequencer.
Copy operator used to remove scene_sound from strips, but Paste operator didn't
restore which lead to total silence of newly added strips.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index e88664ac817..ef1c86b0e84 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2555,12 +2555,12 @@ void SEQUENCER_OT_rendersize(wmOperatorType *ot) /* properties */ } -static void seq_del_sound(Scene *scene, Sequence *seq) +static void seq_copy_del_sound(Scene *scene, Sequence *seq) { if(seq->type == SEQ_META) { Sequence *iseq; for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) { - seq_del_sound(scene, iseq); + seq_copy_del_sound(scene, iseq); } } else if(seq->scene_sound) { @@ -2611,7 +2611,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op) /* Need to remove anything that references the current scene */ for(seq= seqbase_clipboard.first; seq; seq= seq->next) { - seq_del_sound(scene, seq); + seq_copy_del_sound(scene, seq); } return OPERATOR_FINISHED; @@ -2634,6 +2634,19 @@ void SEQUENCER_OT_copy(wmOperatorType *ot) /* properties */ } +static void seq_paste_add_sound(Scene *scene, Sequence *seq) +{ + if(seq->type == SEQ_META) { + Sequence *iseq; + for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) { + seq_paste_add_sound(scene, iseq); + } + } + else if(seq->type == SEQ_SOUND) { + seq->scene_sound = sound_add_scene_sound_defaults(scene, seq); + } +} + static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -2660,9 +2673,13 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) BLI_movelisttolist(ed->seqbasep, &nseqbase); /* make sure the pasted strips have unique names between them */ - for(; iseq; iseq=iseq->next) + for(; iseq; iseq=iseq->next) { seq_recursive_apply(iseq, apply_unique_name_cb, scene); + /* restore valid sound_scene for newly added strips */ + seq_paste_add_sound(scene, iseq); + } + WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); return OPERATOR_FINISHED; |