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-12-04 06:51:52 +0300
committerJoshua Leung <aligorith@gmail.com>2009-12-04 06:51:52 +0300
commit45955fef18c57a5d5633b88e823a9bb9d86b38e4 (patch)
tree3388b4df8b3fb6f42108bd0ae2894f22c22e0046 /source/blender/editors/space_graph
parenta9b9993414e0b2b6154fae78c7bbce4f5fdb20f8 (diff)
Bugfixes: Deleting Keyframes + F-Curves
This commit fixes #19908 and #20239. Deleting keyframes will now delete the F-Curves they came from too, if the F-Curves don't have any more keyframes and/or F-Modifiers providing any further motion info.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_edit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 381d5becb1e..f20ebcc67b9 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -792,7 +792,15 @@ static void delete_graph_keys (bAnimContext *ac)
/* loop through filtered data and delete selected keys */
for (ale= anim_data.first; ale; ale= ale->next) {
- delete_fcurve_keys((FCurve *)ale->key_data); // XXX... this doesn't delete empty curves anymore
+ FCurve *fcu= (FCurve *)ale->key_data;
+ AnimData *adt= ale->adt;
+
+ /* delete selected keyframes only */
+ delete_fcurve_keys(fcu);
+
+ /* Only delete curve too if it won't be doing anything anymore */
+ if ((fcu->totvert == 0) && (list_has_suitable_fmodifier(&fcu->modifiers, 0, FMI_TYPE_GENERATE_CURVE) == 0))
+ ANIM_fcurve_delete_from_animdata(ac, ale->adt, fcu);
}
/* free filtered list */