Skip to main content

animation_curve_optimize

Functions

Computes importance by checking Position AND Slope integrity. Uses exact derivative calculation instead of neighbor sampling

Will remove keyframes that do not affect the shape of the curve significantly. The error tolerance determines the significance degree. Intended to reduce the complexity of a curve to improve performance and lower memory usage

compute_keyframe_value_effect(key_middle, key_previous, key_next) ⇒ number

Computes importance by checking Position AND Slope integrity. Uses exact derivative calculation instead of neighbor sampling

Kind: global function
Returns: number - value delta if the middle frame is removed, the higher this value - the more important the middle keyframe is
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025

ParamType
key_middleKeyframe
key_previousKeyframe
key_nextKeyframe

animation_curve_optimize(curve, [error_tolerance]) ⇒ number

Will remove keyframes that do not affect the shape of the curve significantly. The error tolerance determines the significance degree. Intended to reduce the complexity of a curve to improve performance and lower memory usage

Kind: global function
Returns: number - number of removed keys, 0 if curve was unchanged
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025

ParamTypeDescription
curveAnimationCurveThe curve to optimize. The curve is modified in place.
[error_tolerance]numberhow much of a loss to accept, this is relative to normalized value bounds of the curve