diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-07 20:37:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-07 20:37:41 +0400 |
commit | 6debe0fcf6ac0978162808621f7fa29e104f833b (patch) | |
tree | 39d6f29187ed59fdca789c2b3755ee73bc318e4f /source/blender/editors/space_sequencer | |
parent | 9ab34c36edbb3fc12ff86f95e502bab9d722b11a (diff) |
fix for duplicating metastrips, unique names and animation data.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 1983a33dc84..75774043c68 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1588,6 +1588,18 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot) } /* duplicate operator */ +static int apply_unique_name_cb(Sequence *seq, void *arg_pt) +{ + Scene *scene= (Scene *)arg_pt; + char name[sizeof(seq->name)-2]; + + strcpy(name, seq->name+2); + seqbase_unique_name_recursive(&scene->ed->seqbase, seq); + seq_dupe_animdata(scene, name, seq->name+2); + return 1; + +} + static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -1605,12 +1617,8 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op) /* rely on the nseqbase list being added at the end */ addlisttolist(ed->seqbasep, &nseqbase); - for( ; seq; seq= seq->next) { - char name[sizeof(seq->name)-2]; - strcpy(name, seq->name+2); - seqbase_unique_name_recursive(&ed->seqbase, seq); - seq_dupe_animdata(scene, name, seq->name+2); - } + for( ; seq; seq= seq->next) + seq_recursive_apply(seq, apply_unique_name_cb, scene); WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, scene); return OPERATOR_FINISHED; |