From 570fbba3f33484111a472a835522d5ec30143a7c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 13 Mar 2016 03:49:26 +1300 Subject: 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. --- source/blender/python/intern/bpy_rna_anim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/python/intern/bpy_rna_anim.c') diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 63bfdc63e4d..e74a5185ab0 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -211,6 +211,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb int index = -1; float cfra = FLT_MAX; const char *group_name = NULL; + char keytype = BEZT_KEYTYPE_KEYFRAME; /* XXX: Expose this as a one-off option... */ int options = 0; PYRNA_STRUCT_CHECK_OBJ(self); @@ -227,7 +228,7 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb BKE_reports_init(&reports, RPT_STORE); - result = insert_keyframe(&reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, options); + result = insert_keyframe(&reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, keytype, options); MEM_freeN((void *)path_full); if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1) -- cgit v1.2.3