Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-02 23:49:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-02 23:49:09 +0400
commit1768a96774093a4b0d4674c683b2fb39564f0ad5 (patch)
treef7ee071d0cf5eb31e933c2a5d9a58990de86784f /source/blender/editors/animation
parent725207a1e6ba949834210c8230dd5602ea9728ca (diff)
Fix #29073: keyframing integer properties now uses linear interpolation
by default, and enums use constant interpolation. Bezier doesn't make much sense for these.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/keyframing.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 9f466ef52d3..4595bf3f64f 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -310,10 +310,17 @@ int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag)
beztr.vec[1][1]= y;
beztr.vec[2][0]= x+1.0f;
beztr.vec[2][1]= y;
- beztr.ipo= U.ipo_new; /* use default interpolation mode here... */
beztr.f1= beztr.f2= beztr.f3= SELECT;
beztr.h1= beztr.h2= U.keyhandles_new; /* use default handle type here */
//BEZKEYTYPE(&beztr)= scene->keytype; /* default keyframe type */
+
+ /* use default interpolation mode, with exceptions for int/discrete values */
+ beztr.ipo= U.ipo_new;
+
+ if(fcu->flag & FCURVE_DISCRETE_VALUES)
+ beztr.ipo = BEZT_IPO_CONST;
+ else if(beztr.ipo == BEZT_IPO_BEZ && (fcu->flag & FCURVE_INT_VALUES))
+ beztr.ipo = BEZT_IPO_LIN;
/* add temp beztriple to keyframes */
a= insert_bezt_fcurve(fcu, &beztr, flag);