[Bf-blender-cvs] [3370af2dc1c] master: Fix T70281: Changing Default interpolation also changes curve of new drivers
Sybren A. Stüvel
noreply at git.blender.org
Tue Oct 1 11:59:36 CEST 2019
Commit: 3370af2dc1ced49099a4a7e6e15f3ffd009d91ca
Author: Sybren A. Stüvel
Date: Fri Sep 27 17:02:02 2019 +0200
Branches: master
https://developer.blender.org/rB3370af2dc1ced49099a4a7e6e15f3ffd009d91ca
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
===================================================================
M source/blender/editors/animation/drivers.c
===================================================================
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);
}
More information about the Bf-blender-cvs
mailing list