Page MenuHome

Preserve F-Curve shape with manual handles when inserting keyframes.
AbandonedPublic

Authored by Alexander Gavrilov (angavrilov) on Apr 22 2018, 6:51 PM.

Details

Summary

During animation it is preferrable that inserting a keyframe without
changing object position doesn't change the curve shape. For curves
that use Auto keyframes this has been largely addressed by the new
algorithm from D2884, but that doesn't apply to non-auto handles.

This patch applies the de-Casteljau algorithm to split the bezier
curve at the X coordinate where the new key is inserted, and uses
the result to update both the newly inserted and existing surrounding
handles.

Key deletion code is also modified so that it attempts to revert
the effect of an assumed prior subdivision done by the above method.
Of course, when the key being deleted isn't actually redundant, it
is impossible to preserve the shape of the curve.

The idea for this patch come from D2642, but the implementation has
been almost completely rewritten to use existing math code better.

Also, contrary to that patch, this version considers that switching
a key from Auto to manual incurs a significant usability cost,
and only ever does it if the curve shape is already defined by
manual handles. When dealing with a curve area that is purely
Auto, the new code won't even run.

Diff Detail

Repository
rB Blender
Branch
fcurve-manual-subdivide
Build Status
Buildable 1444
Build 1444: arc lint + arc unit