From 3370af2dc1ced49099a4a7e6e15f3ffd009d91ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 27 Sep 2019 17:02:02 +0200 Subject: [PATCH] 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 --- source/blender/editors/animation/drivers.c | 12 ++++-------- 1 file 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); }