mmSolver.tools.smoothkeyframes#

Smooth keyframes tool - Smooth the keyframe values of Animation Curves.

Tools#

Smooths the selected keyframes.

mmSolver.tools.smoothkeyframes.tool.smooth_selected_keyframes()#

Smooth the selected keyframes in the Graph Editor.

Usage:

  1. Select keyframes in Graph Editor.

  2. Run tool

  3. Keyframe values will be smoothed.

mmSolver.tools.smoothkeyframes.tool.main()#

Library#

Functions to support smoothing animation curve keyframes.

mmSolver.tools.smoothkeyframes.lib.calculate_chunks(selected_keyframes, all_times, all_values)#

Create a list of chunks; each chunk is a list of time values.

all_times is assumed to already be sorted.

mmSolver.tools.smoothkeyframes.lib.create_first_last_keyframe_animCurve(selected_keyframes, all_times, all_values)#
mmSolver.tools.smoothkeyframes.lib.blend_curves_with_difference(selected_keyframes, all_times, value_array, new_value_array)#

Create a new array of values based on the difference between value_array at the start/end of of each chunk of selected keyframes.

The algorithm works like this:

  1. Calculate chunks.

  2. Create a linear curve between start/end keyframe values of the smoothed curve.

  3. Subtract the linear curve from the smoothed curve.

  4. Create another linear curve between start/end keyframe values of the value curve.

  5. Subtract the linear curve from the value curve.

  6. Add the difference between the linear value curve and the linear smooth curve, to the smoothed curve.

  7. Blend between the smooth and original value.

Return type:

[float, ..]

mmSolver.tools.smoothkeyframes.lib.smooth_animcurve(animcurve, selected_keyframes, smooth_type, width, blend_smooth_type, blend_width)#

Smooth the given keyframes for an animCurve.

Parameters:
  • animcurve (str) – Animation curve node name.

  • selected_keyframes ([int, ..] or []) – The frame numbers that are ‘selected’ to be smoothed.

  • smooth_type – What algorithm to use for smoothing.

  • width (float) – The width of the smoothing kernel; higher values produce more smoothing, and is slower to compute.

  • blend_smooth_type – What algorithm to use for smoothing the blend?

  • blend_width (float) – The width of the smoothing kernel; higher values produce more smoothing, and is slower to compute.

UI - Layout#

UI - Window#

Constants#

Smooth keyframes constants.