chromakode / fcurve

JS port of Blender's animation bezier curve evaluator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fcurve

Build Status Coverage Status npm npm

Blender uses bezier curves to control animations called FCurves. This library is a port of the evaluator. Given the same control point information, it should produce the same output (within a few points of numeric precision). This is verified by running Blender with the same curves and comparing the values. (:warning: though we're not getting 100% code coverage yet)

Currently, only the bezier interpolation mode is fully supported.

In JS, FCurves should be represented like this:

{
  points: [
    {
      // point interpolation mode (only 'BEZIER' supported)
      interpolation: 'BEZIER',
      // (x, y) coordinate of point
      co: [10, 0],
      // (x, y) coordinate of left handle
      left: [-50, 0],
      // (x, y) coordinate of right handle
      right: [50, 0],
    },
    {
      interpolation: 'BEZIER',
      co: [120, -3],
      left: [70, -3],
      right: [170, -3],
    },
  ]
}

About

JS port of Blender's animation bezier curve evaluator

License:GNU General Public License v2.0


Languages

Language:JavaScript 96.6%Language:Python 3.4%