diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-03-12 17:49:26 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-03-13 08:28:30 +0300 |
commit | 570fbba3f33484111a472a835522d5ec30143a7c (patch) | |
tree | 061c03e275a602490afccefac1ed98a553ba2a9a /source/blender/editors/animation/keyframes_general.c | |
parent | b10e3cc9973e415189e9f0cdb6af504c41dd9e41 (diff) |
Keyframing: Added ToolSetting for choosing default keyframe type
To make it easier for animators working in a multipass pose-to-pose workflow
when inserting breakdown keyframes and so forth, it is now possible to specify
the "type" of keyframe being created (i.e. the colour of the keyframe, when drawn
in the Dope Sheet).
Usage:
1) Choose the type of keyframe ("Keyframe", "Breakdown", "Extreme", etc.) from
the new dropdown located between the AutoKeying and KeyingSet widgets on the
timeline header.
2) Insert keyframes
3) Rejoyce that your newly created keyframes have now been coloured for you already
in the DopeSheet.
Todo:
* Look into a way of using the actual keyframe colours (from the theme) for the icons
of these types.
Diffstat (limited to 'source/blender/editors/animation/keyframes_general.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index bd8aa211c46..9733d920b78 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -203,7 +203,7 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo /* now insert first keyframe, as it should be ok */ bezt = old_bezts; - insert_vert_fcurve(fcu, bezt->vec[1][0], bezt->vec[1][1], 0); + insert_vert_fcurve(fcu, bezt->vec[1][0], bezt->vec[1][1], BEZKEYTYPE(bezt), 0); if (!(bezt->f2 & SELECT)) { lastb = fcu->bezt; lastb->f1 = lastb->f2 = lastb->f3 = 0; @@ -226,13 +226,13 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo } lastb = (fcu->bezt + (fcu->totvert - 1)); bezt = (old_bezts + i); - + /* get references for quicker access */ prev[0] = lastb->vec[1][0]; prev[1] = lastb->vec[1][1]; cur[0] = bezt->vec[1][0]; cur[1] = bezt->vec[1][1]; - + if (!(bezt->f2 & SELECT)) { - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); lastb = (fcu->bezt + (fcu->totvert - 1)); lastb->f1 = lastb->f2 = lastb->f3 = 0; continue; @@ -251,7 +251,7 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo if (cur[1] > next[1]) { if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); } } } @@ -259,7 +259,7 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo /* only add if values are a considerable distance apart */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); } } } @@ -269,18 +269,18 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo /* does current have same value as previous and next? */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe*/ - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); } else if (IS_EQT(cur[1], next[1], thresh) == 0) { /* add new keyframe */ - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); } } else { /* add if value doesn't equal that of previous */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_fcurve(fcu, cur[0], cur[1], 0); + insert_vert_fcurve(fcu, cur[0], cur[1], BEZKEYTYPE(bezt), 0); } } } @@ -436,7 +436,7 @@ void sample_fcurve(FCurve *fcu) BezTriple *bezt, *start = NULL, *end = NULL; TempFrameValCache *value_cache, *fp; int sfra, range; - int i, n, nIndex; + int i, n; if (fcu->bezt == NULL) /* ignore baked */ return; @@ -467,8 +467,7 @@ void sample_fcurve(FCurve *fcu) /* add keyframes with these, tagging as 'breakdowns' */ for (n = 1, fp = value_cache; n < range && fp; n++, fp++) { - nIndex = insert_vert_fcurve(fcu, fp->frame, fp->val, 1); - BEZKEYTYPE(fcu->bezt + nIndex) = BEZT_KEYTYPE_BREAKDOWN; + insert_vert_fcurve(fcu, fp->frame, fp->val, BEZT_KEYTYPE_BREAKDOWN, 1); } /* free temp cache */ |