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:
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 */