[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23008] branches/blender2.5/blender/source /blender: 2.5 - Animation Tweaks
Joshua Leung
aligorith at gmail.com
Sat Sep 5 00:50:15 CEST 2009
Revision: 23008
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23008
Author: aligorith
Date: 2009-09-05 00:50:15 +0200 (Sat, 05 Sep 2009)
Log Message:
-----------
2.5 - Animation Tweaks
* Sequencer data is now animateable. Was missing a 'path' setting. For now, sequencer data is animated under scene, since SequenceEditor is not an ID block.
* Fixed some buggy insert-keyframe code.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
Modified: branches/blender2.5/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-09-04 22:07:33 UTC (rev 23007)
+++ branches/blender2.5/blender/source/blender/editors/animation/keyframing.c 2009-09-04 22:50:15 UTC (rev 23008)
@@ -292,15 +292,9 @@
}
}
else if ((flag & INSERTKEY_REPLACE) == 0) {
- /* add new - if we're not restricted to replacing keyframes only */
- BezTriple *newb;
+ /* insert new - if we're not restricted to replacing keyframes only */
+ BezTriple *newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple");
- /* allocate a new array only if we have to */
- if ((flag & INSERTKEY_FASTR) == 0)
- newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple");
- else
- newb= fcu->bezt;
-
/* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */
if (i > 0)
memcpy(newb, fcu->bezt, i*sizeof(BezTriple));
@@ -313,11 +307,9 @@
memcpy(newb+i+1, fcu->bezt+i, (fcu->totvert-i)*sizeof(BezTriple));
/* replace (+ free) old with new, only if necessary to do so */
- if ((flag & INSERTKEY_FASTR) == 0) {
- MEM_freeN(fcu->bezt);
- fcu->bezt= newb;
- }
-
+ MEM_freeN(fcu->bezt);
+ fcu->bezt= newb;
+
fcu->totvert++;
}
}
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c 2009-09-04 22:07:33 UTC (rev 23007)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_sequence.c 2009-09-04 22:50:15 UTC (rev 23008)
@@ -221,6 +221,16 @@
}
}
+static char *rna_Sequence_path(PointerRNA *ptr)
+{
+ Sequence *seq= (Sequence*)ptr->data;
+
+ /* sequencer data comes from scene...
+ * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths)
+ */
+ return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2);
+}
+
static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter)
{
ListBaseIterator *internal= iter->internal;
@@ -393,6 +403,7 @@
srna = RNA_def_struct(brna, "Sequence", NULL);
RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor.");
RNA_def_struct_refine_func(srna, "rna_Sequence_refine");
+ RNA_def_struct_path_func(srna, "rna_Sequence_path");
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set");
More information about the Bf-blender-cvs
mailing list