diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-26 16:06:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-26 16:06:45 +0300 |
commit | 3e4a7f4366433842880dc06895d699a54838ad5d (patch) | |
tree | 92412abe0c9659f555e951c9238a1ea9204ccee5 /source/blender/editors/animation | |
parent | 76df0ec93a217693c75ee2890ce498e2ab244e9e (diff) |
Fix T45275: F-Curve normalization might corrupt animation
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 33a5447698a..ed3d228a93e 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -289,12 +289,22 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo if (flag & ANIM_UNITCONV_NORMALIZE_FREEZE) { if (r_offset) *r_offset = fcu->prev_offset; + if (fcu->prev_norm_factor == 0.0f) { + /* Happens when Auto Normalize was disabled before + * any curves were displayed. + */ + return 1.0f; + } return fcu->prev_norm_factor; } if (G.moving & G_TRANSFORM_FCURVES) { if (r_offset) *r_offset = fcu->prev_offset; + if (fcu->prev_norm_factor == 0.0f) { + /* Same as above. */ + return 1.0f; + } return fcu->prev_norm_factor; } @@ -342,7 +352,7 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo } offset = -min_coord - range / 2.0f; } - + BLI_assert(factor != 0.0f); if (r_offset) { *r_offset = offset; } |