Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/drivers.c
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | if (creation_mode == DRIVER_FCURVE_GENERATOR) { | ||||
| * for now before 2.7 series -- (September 4, 2013) | * for now before 2.7 series -- (September 4, 2013) | ||||
| */ | */ | ||||
| add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR, fcu); | add_fmodifier(&fcu->modifiers, FMODIFIER_TYPE_GENERATOR, fcu); | ||||
| } | } | ||||
| else { | else { | ||||
| /* add 2 keyframes so that user has something to work with | /* add 2 keyframes so that user has something to work with | ||||
| * - These are configured to 0,0 and 1,1 to give a 1-1 mapping | * - These are configured to 0,0 and 1,1 to give a 1-1 mapping | ||||
| * which can be easily tweaked from there. | * which can be easily tweaked from there. | ||||
| */ | */ | ||||
| insert_vert_fcurve(fcu, 0.0f, 0.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST); | insert_vert_fcurve( | ||||
angavrilov: I wonder what's the point of this - two keys with bezier and linear extrapolation already makes… | |||||
| insert_vert_fcurve(fcu, 1.0f, 1.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST); | fcu, 0.0f, 0.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST | INSERTKEY_NO_USERPREF); | ||||
| insert_vert_fcurve( | |||||
| /* configure this curve to extrapolate */ | fcu, 1.0f, 1.0f, BEZT_KEYTYPE_KEYFRAME, INSERTKEY_FAST | INSERTKEY_NO_USERPREF); | ||||
| for (i = 0, bezt = fcu->bezt; (i < fcu->totvert) && bezt; i++, bezt++) { | |||||
| bezt->h1 = bezt->h2 = HD_VECT; | |||||
| } | |||||
| fcu->extend = FCURVE_EXTRAPOLATE_LINEAR; | fcu->extend = FCURVE_EXTRAPOLATE_LINEAR; | ||||
| calchandles_fcurve(fcu); | calchandles_fcurve(fcu); | ||||
| } | } | ||||
| } | } | ||||
| return fcu; | return fcu; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,175 Lines • Show Last 20 Lines | |||||
I wonder what's the point of this - two keys with bezier and linear extrapolation already makes it linear.