diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index fc6865c3ed1..42a15939aee 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3548,7 +3548,7 @@ static void posttrans_fcurve_clean(FCurve *fcu, const bool use_handle) /* If there's another selected frame here, merge it */ for (tRetainedKeyframe *rk = retained_keys.last; rk; rk = rk->prev) { if (IS_EQT(rk->frame, bezt->vec[1][0], BEZT_BINARYSEARCH_THRESH)) { - rk->val += (bezt->vec[1][1] - rk->val) / ((float)rk->tot_count); + rk->val += bezt->vec[1][1]; rk->tot_count++; found = true; @@ -3580,6 +3580,12 @@ static void posttrans_fcurve_clean(FCurve *fcu, const bool use_handle) } return; } + else { + /* Compute the average values for each retained keyframe */ + for (tRetainedKeyframe *rk = retained_keys.first; rk; rk = rk->next) { + rk->val = rk->val / (float)rk->tot_count; + } + } /* 2) Delete all keyframes duplicating the "retained keys" found above * - Most of these will be unselected keyframes |