diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-02-09 14:05:34 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-02-09 14:05:34 +0300 |
commit | c58d336a33b4105530af326dccef077ba0274fa6 (patch) | |
tree | 0c3cccdd29849878a5722d3253d039fc8a59c35b /source/blender/editors/animation | |
parent | 2b818935fe708f5f386375d484faa35b9163b4c7 (diff) |
Keyframe-related bugfixes:
* Deleting keyframes should be safer now
* Graph Editor no longer crashes on F-Curves with no keyframes/samples
* Silenced console prints that occurred when an F-Curve had now keyframes.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 7 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 30d05b91582..cf7d56da5d9 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -103,6 +103,13 @@ void delete_fcurve_keys(FCurve *fcu) } } + /* Free the array of BezTriples if there are not keyframes */ + if (fcu->totvert == 0) { + if (fcu->bezt) + MEM_freeN(fcu->bezt); + fcu->bezt= NULL; + } + #if 0 // XXX for now, we don't get rid of empty curves... /* Only delete if there isn't an ipo-driver still hanging around on an empty curve */ if ((icu->totvert==0) && (icu->driver==NULL)) { diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 110fd84a630..df3a7b85a45 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -2267,7 +2267,7 @@ short action_frame_has_keyframe (bAction *act, float frame, short filter) */ for (fcu= act->curves.first; fcu; fcu= fcu->next) { /* only check if there are keyframes (currently only of type BezTriple) */ - if (fcu->bezt) { + if (fcu->bezt && fcu->totvert) { /* we either include all regardless of muting, or only non-muted */ if ((filter & ANIMFILTER_KEYS_MUTED) || (fcu->flag & FCURVE_MUTED)==0) { short replace = -1; |