diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-09-27 18:02:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-10-01 12:56:32 +0300 |
commit | 3370af2dc1ced49099a4a7e6e15f3ffd009d91ca (patch) | |
tree | 72f30d8f5bd58174f5946749838f3aaaa559d075 /source/blender/editors/animation | |
parent | 2746fbc93558f8296220d3d94d3db6957eb9f67d (diff) |
Fix T70281: Changing Default interpolation also changes curve of new drivers
Having a constant FCurve doesn't make sense for drivers; either linear
or Bezier should be used. Since the code is already creating a Bezier
curve, I just added the flag to not look at the user preferences in this
case.
Reviewed by: angavrilov
Differential Revision: https://developer.blender.org/D5921
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/drivers.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index e75dd92e90b..121683be407 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -139,14 +139,10 @@ struct FCurve *alloc_driver_fcurve(const char rna_path[], * - These are configured to 0,0 and 1,1 to give a 1-1 mapping * which can be easily tweaked from there. */ - insert_vert_fcurve(fcu, 0.0f, 0.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST); - insert_vert_fcurve(fcu, 1.0f, 1.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST); - - /* configure this curve to extrapolate */ - for (i = 0, bezt = fcu->bezt; (i < fcu->totvert) && bezt; i++, bezt++) { - bezt->h1 = bezt->h2 = HD_VECT; - } - + insert_vert_fcurve( + fcu, 0.0f, 0.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST | INSERTKEY_NO_USERPREF); + insert_vert_fcurve( + fcu, 1.0f, 1.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST | INSERTKEY_NO_USERPREF); fcu->extend = FCURVE_EXTRAPOLATE_LINEAR; calchandles_fcurve(fcu); } |