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/transform/transform_conversions.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/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 03e3fa02d12..d52db8c8388 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5521,6 +5521,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, // TODO: this should probably be done per channel instead... if (autokeyframe_cfra_can_key(scene, id)) { ReportList *reports = CTX_wm_reports(C); + ToolSettings *ts = scene->toolsettings; KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene); ListBase dsources = {NULL, NULL}; float cfra = (float)CFRA; // xxx this will do for now @@ -5547,7 +5548,8 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, fcu->flag &= ~FCURVE_SELECTED; insert_keyframe(reports, id, adt->action, (fcu->grp ? fcu->grp->name : NULL), - fcu->rna_path, fcu->array_index, cfra, flag); + fcu->rna_path, fcu->array_index, cfra, + ts->keyframe_type, flag); } } } @@ -5639,6 +5641,7 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o // TODO: this should probably be done per channel instead... if (autokeyframe_cfra_can_key(scene, id)) { ReportList *reports = CTX_wm_reports(C); + ToolSettings *ts = scene->toolsettings; KeyingSet *active_ks = ANIM_scene_get_active_keyingset(scene); float cfra = (float)CFRA; short flag = 0; @@ -5679,9 +5682,13 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o /* only if bone name matches too... * NOTE: this will do constraints too, but those are ok to do here too? */ - if (pchanName && STREQ(pchanName, pchan->name)) - insert_keyframe(reports, id, act, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, flag); - + if (pchanName && STREQ(pchanName, pchan->name)) { + insert_keyframe(reports, id, act, + ((fcu->grp) ? (fcu->grp->name) : (NULL)), + fcu->rna_path, fcu->array_index, cfra, + ts->keyframe_type, flag); + } + if (pchanName) MEM_freeN(pchanName); } } |