diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-13 12:52:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-13 12:52:49 +0300 |
commit | 4cfa5d55e60b4b51e64da347d51991a8713e26b6 (patch) | |
tree | 165e9cc5f06d5497c96ab7ead21ea36a9cd0c7f7 /source/blender/makesrna/intern/rna_fcurve.c | |
parent | cf8cc39d4cf5a5e85070f4e3c99c383159d60940 (diff) |
rna/api: new bezier keys added via fcu.keyframe_points.add() now use auto handles and bezier interpolation.
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index ea6398701f9..05d96c6d6ea 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -561,6 +561,7 @@ static BezTriple *rna_FKeyframe_points_insert(FCurve *fcu, float frame, float va static void rna_FKeyframe_points_add(FCurve *fcu, int tot) { if(tot > 0) { + BezTriple *bezt; if(fcu->totvert) { BezTriple *nbezt= MEM_callocN(sizeof(BezTriple) * (fcu->totvert + tot), "rna_FKeyframe_points_add"); memcpy(nbezt, fcu->bezt, sizeof(BezTriple) * fcu->totvert); @@ -571,7 +572,16 @@ static void rna_FKeyframe_points_add(FCurve *fcu, int tot) fcu->bezt= MEM_callocN(sizeof(BezTriple) * tot, "rna_FKeyframe_points_add"); } + bezt= fcu->bezt + fcu->totvert; fcu->totvert += tot; + + while(tot--) { + /* defaults, no userprefs gives pradictable results for API */ + bezt->f1= bezt->f2= bezt->f3= SELECT; + bezt->ipo= BEZT_IPO_BEZ; + bezt->h1= bezt->h2= HD_AUTO; + bezt++; + } } } |