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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-05-16 09:47:57 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-05-16 09:48:46 +0300
commit65199828766afff21b1a1741fd5a7d651d92f17d (patch)
treeaa3a5f22e83b421044706162ce35d6fc4d92836b /source/blender/editors
parente097845a6fab925a364b029c7b709db2b46176e1 (diff)
Fix T64681: evaluate curves with generative modifiers and no keys.
Introduce a new function and use it everywhere, including automatic curve deletion checks to guarantee consistency.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/keyframes_general.c3
-rw-r--r--source/blender/editors/animation/keyframing.c3
-rw-r--r--source/blender/editors/interface/interface_anim.c2
-rw-r--r--source/blender/editors/space_action/action_edit.c3
-rw-r--r--source/blender/editors/space_graph/graph_edit.c4
5 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c
index 5214c5f78fa..be8de66a262 100644
--- a/source/blender/editors/animation/keyframes_general.c
+++ b/source/blender/editors/animation/keyframes_general.c
@@ -315,8 +315,7 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo
clear_fcurve_keys(fcu);
/* check if curve is really unused and if it is, return signal for deletion */
- if ((list_has_suitable_fmodifier(&fcu->modifiers, 0, FMI_TYPE_GENERATE_CURVE) == 0) &&
- (fcu->driver == NULL)) {
+ if (BKE_fcurve_is_empty(fcu)) {
AnimData *adt = ale->adt;
ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
ale->key_data = NULL;
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 97d85d25d66..2dc17c5c397 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1557,8 +1557,7 @@ static bool delete_keyframe_fcurve(AnimData *adt, FCurve *fcu, float cfra)
delete_fcurve_key(fcu, i, 1);
/* 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)) {
+ if (BKE_fcurve_is_empty(fcu)) {
ANIM_fcurve_delete_from_animdata(NULL, adt, fcu);
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index e34d67b6996..4a0a19f57cf 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -83,7 +83,7 @@ void ui_but_anim_flag(uiBut *but, float cfra)
if (fcu) {
if (!driven) {
/* Empty curves are ignored by the animation evaluation system. */
- if (fcu->totvert == 0) {
+ if (BKE_fcurve_is_empty(fcu)) {
return;
}
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index d8ed25c86d3..7fc84db3f75 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -979,8 +979,7 @@ static bool delete_action_keys(bAnimContext *ac)
changed = 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)) {
+ if (BKE_fcurve_is_empty(fcu)) {
ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
ale->key_data = NULL;
}
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index c5f8c32ec7a..8329218eea9 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -1172,9 +1172,7 @@ static bool delete_graph_keys(bAnimContext *ac)
}
/* 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) &&
- (fcu->driver == NULL)) {
+ if (BKE_fcurve_is_empty(fcu)) {
ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
ale->key_data = NULL;
}