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:
authorJoshua Leung <aligorith@gmail.com>2009-02-09 14:05:34 +0300
committerJoshua Leung <aligorith@gmail.com>2009-02-09 14:05:34 +0300
commitc58d336a33b4105530af326dccef077ba0274fa6 (patch)
tree0c3cccdd29849878a5722d3253d039fc8a59c35b
parent2b818935fe708f5f386375d484faa35b9163b4c7 (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.
-rw-r--r--source/blender/blenkernel/intern/action.c8
-rw-r--r--source/blender/editors/animation/keyframes_general.c7
-rw-r--r--source/blender/editors/animation/keyframing.c2
-rw-r--r--source/blender/editors/space_graph/graph_draw.c18
4 files changed, 24 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 4e66d5f0ab8..9ed469c9028 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -313,10 +313,14 @@ void action_groups_add_channel (bAction *act, bActionGroup *agrp, FCurve *fcurve
}
/* only if added, set channel as belonging to this group */
- if (done)
+ if (done) {
+ //printf("FCurve added to group \n");
fcurve->grp= agrp;
- else
+ }
+ else {
printf("Error: FCurve '%s' couldn't be added to Group '%s' \n", fcurve->rna_path, agrp->name);
+ BLI_addtail(&act->curves, fcurve);
+ }
}
/* Remove the given channel from all groups */
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;
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index f05606fbfa6..8de273c9428 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -632,14 +632,16 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 0, 0);
/* draw curve - we currently calculate colour on the fly, but that should probably be done in advance instead */
- col= ipo_rainbow(i, items);
- cpack(col);
-
- draw_fcurve_repeat(fcu, &ar->v2d, 0, 0, &fac); // XXX this call still needs a lot more work
-
- /* draw handles and vertices as appropriate */
- draw_fcurve_handles(sipo, ar, fcu);
- draw_fcurve_vertices(sipo, ar, fcu);
+ if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) {
+ col= ipo_rainbow(i, items);
+ cpack(col);
+
+ draw_fcurve_repeat(fcu, &ar->v2d, 0, 0, &fac); // XXX this call still needs a lot more work
+
+ /* draw handles and vertices as appropriate */
+ draw_fcurve_handles(sipo, ar, fcu);
+ draw_fcurve_vertices(sipo, ar, fcu);
+ }
/* undo mapping of keyframes for drawing if scaled F-Curve */
if (nob)