diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-09-05 02:50:15 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-09-05 02:50:15 +0400 |
commit | ec5a8c010c8100a1709786f81d5b9b501383287a (patch) | |
tree | 4493b4ac8a817d6ad73e0153926d7354c7fdf69b /source/blender/editors/animation/keyframing.c | |
parent | eaa079b9b7e8650411da90419fce73ffe3334f55 (diff) |
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.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index d731ec6f148..7135f8802bc 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -292,14 +292,8 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) } } else if ((flag & INSERTKEY_REPLACE) == 0) { - /* add new - if we're not restricted to replacing keyframes only */ - BezTriple *newb; - - /* 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; + /* insert new - if we're not restricted to replacing keyframes only */ + BezTriple *newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple"); /* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */ if (i > 0) @@ -313,11 +307,9 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) 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++; } } |