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/blenkernel/BKE_fcurve.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/blenkernel/BKE_fcurve.h') diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 3ae7ebf5d80..ae87009b4a1 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -273,6 +273,17 @@ bool BKE_fcurve_is_protected(struct FCurve *fcu); /* The curve is an infinite cycle via Cycles modifier */ bool BKE_fcurve_is_cyclic(struct FCurve *fcu); +/* Type of infinite cycle for a curve. */ +typedef enum eFCU_Cycle_Type { + FCU_CYCLE_NONE = 0, + /* The cycle repeats identically to the base range. */ + FCU_CYCLE_PERFECT, + /* The cycle accumulates the change between start and end keys. */ + FCU_CYCLE_OFFSET +} eFCU_Cycle_Type; + +eFCU_Cycle_Type BKE_fcurve_get_cycle_type(struct FCurve *fcu); + /* -------- Curve Sanity -------- */ void calchandles_fcurve(struct FCurve *fcu); -- cgit v1.2.3