Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-07 20:17:18 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-07 20:17:18 +0400
commite8be069870b9125e87d533cbb84cf049be5d1442 (patch)
tree628ac52173b6b121fa1e70e0242896d4cefe4e62 /source/blender/blenkernel/intern
parentf65c15cd5a269b0a95171e5168dfd6795265cdf6 (diff)
duplicating a sequence strip now duplicates its fcurves
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index cf9e159bafb..2bf328147c8 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -40,6 +40,7 @@
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
+#include "BKE_animsys.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
@@ -3877,6 +3878,37 @@ void seq_offset_animdata(Scene *scene, Sequence *seq, int ofs)
}
}
+void seq_dupe_animdata(Scene *scene, char *name_from, char *name_to)
+{
+ char str_from[32];
+ char str_to[32];
+ FCurve *fcu;
+ FCurve *fcu_last;
+ FCurve *fcu_cpy;
+ ListBase lb= {NULL, NULL};
+
+ if(scene->adt==NULL || scene->adt->action==NULL)
+ return;
+
+ sprintf(str_from, "[\"%s\"]", name_from);
+ sprintf(str_to, "[\"%s\"]", name_to);
+
+ fcu_last= scene->adt->action->curves.last;
+
+ for (fcu= scene->adt->action->curves.first; fcu && fcu->prev != fcu_last; fcu= fcu->next) {
+ if(strstr(fcu->rna_path, "sequence_editor.sequences_all[") && strstr(fcu->rna_path, str_from)) {
+ fcu_cpy= copy_fcurve(fcu);
+ BLI_addtail(&lb, fcu_cpy);
+ }
+ }
+
+ /* notice validate is 0, keep this because the seq may not be added to the scene yet */
+ BKE_animdata_fix_paths_rename(&scene->id, scene->adt, "sequence_editor.sequences_all", name_from, name_to, 0, 0, 0);
+
+ /* add the original fcurves back */
+ addlisttolist(&scene->adt->action->curves, &lb);
+}
+
/* XXX - hackish function needed to remove all fcurves belonging to a sequencer strip */
static void seq_free_animdata(Scene *scene, Sequence *seq)
{
@@ -4233,8 +4265,13 @@ static Sequence *seq_dupli(struct Scene *scene, Sequence *seq, int dupe_flag)
" now...\n");
}
- if(dupe_flag & SEQ_DUPE_UNIQUE_NAME)
+ if(dupe_flag & SEQ_DUPE_UNIQUE_NAME) {
seqbase_unique_name_recursive(&scene->ed->seqbase, seqn);
+ printf("%s %s\n", seqn->name+2, seq->name+2);
+ }
+
+ if(dupe_flag & SEQ_DUPE_ANIM)
+ seq_dupe_animdata(scene, seq->name+2, seqn->name+2);
return seqn;
}