diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-05-28 05:57:29 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-05-28 05:57:29 +0400 |
commit | 4512be4b6cce1333c875380b67695e410e9f58c3 (patch) | |
tree | 45ffc8a4db3a8d3e8b6c171add0252f28467c8d2 /source/blender/editors/animation | |
parent | 5936032f661395f18bcc15c3dba73e8b6f5e963b (diff) |
2.5 - Fixes for animating enum values
Interpolation between keyframes for enum values (and booleans) can only be constant now.
TODO:
A way to do this for modifiers is still needed.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 9a40fb44f47..4a5f9efa968 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -728,8 +728,23 @@ short insert_keyframe (ID *id, bAction *act, const char group[], const char rna_ float curval= 0.0f; /* set additional flags for the F-Curve (i.e. only integer values) */ - if (RNA_property_type(prop) != PROP_FLOAT) - fcu->flag |= FCURVE_INT_VALUES; + fcu->flag &= ~(FCURVE_INT_VALUES|FCURVE_DISCRETE_VALUES); + switch (RNA_property_type(prop)) { + case PROP_FLOAT: + /* do nothing */ + break; + case PROP_INT: + /* do integer (only 'whole' numbers) interpolation between all points */ + fcu->flag |= FCURVE_INT_VALUES; + break; + default: + /* do 'discrete' (i.e. enum, boolean values which cannot take any intermediate + * values at all) interpolation between all points + * - however, we must also ensure that evaluated values are only integers still + */ + fcu->flag |= (FCURVE_DISCRETE_VALUES|FCURVE_INT_VALUES); + break; + } /* apply special time tweaking */ // XXX check on this stuff... |