From 7bc84559aa80841591f1ccf5c09f843931d6dabb Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 14 Oct 2018 13:04:34 +0300 Subject: Add an option to do keyframe insertion in a cycle-aware fashion. When enabled, inserting keyframes into F-Curves with simple cyclic extrapolation (the same conditions as required for cycle-aware auto handle smoothing to activate) will take the cycle into account: - Keyframes that are being inserted outside of the cycle bounds are remapped to be inside the cycle. Thus it is not necessary to be within the main iteration of the cycle when tweaking. This becomes especially useful in the final animation tweaking phase when the channel keys may be staggered for overlap, so the actual master period is different for different channels. - Modifying one of the end points of a cycle also changes the other end point when appropriate, to preserve smooth transition. This feature applies to both manual keyframe insertion using 'I', and auto-keyframing. Differential Revision: https://developer.blender.org/D3140 --- source/blender/makesdna/DNA_anim_types.h | 1 + source/blender/makesdna/DNA_userdef_types.h | 1 + 2 files changed, 2 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index eed84ac7aac..4fee5fc6d70 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -855,6 +855,7 @@ typedef enum eInsertKeyFlags { * Used by copy/paste code. */ INSERTKEY_OVERWRITE_FULL = (1<<7), INSERTKEY_DRIVER = (1<<8), /* for driver FCurves, use driver's "input" value - for easier corrective driver setup */ + INSERTKEY_CYCLE_AWARE = (1<<9), /* for cyclic FCurves, adjust key timing to preserve the cycle period and flow */ } eInsertKeyFlags; /* ************************************************ */ diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index ebe27cd3b38..512481a75b5 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -827,6 +827,7 @@ typedef enum eAutokey_Flag { /* toolsettings->autokey_flag */ AUTOKEY_FLAG_ONLYKEYINGSET = (1 << 6), AUTOKEY_FLAG_NOWARNING = (1 << 7), + AUTOKEY_FLAG_CYCLEAWARE = (1 << 8), ANIMRECORD_FLAG_WITHNLA = (1 << 10), } eAutokey_Flag; -- cgit v1.2.3