Animation using Function Curves

Animations are stored in function curves (FCurves). FCurves contain keys to define a value in an assigned time. Usually, many FCurves (x, y, and z) belong to one FCurveNode.

The FCurveNodes map to the properties of an object. An object has both animatable and non-animatable properties. You can edit the animatable properties of an object by modifying the corresponding FCurves. In the UI, the function curves appear in the FCurves tab when you select an animatable property in the Property list.

To edit the animation, you need to modify the FCurves and keys. In animation using SDK scripting, you need to consider the FCurveNode, FCurve, and key three levels.

The following sections explain how to use the SDK to perform simple animation tasks. To follow the instructions, download the files and scripts from http://area.autodesk.com/downloads/scripts/motionbuilder-animation-scripts.

Creating Animation

Run the create_animation_on_cube.py script in the Python Editor to get a simple FCurve.

Following are the points to keep in mind:

Copying Animation

Keep the last scene open, and then run the copy_animation.py script to copy the animation from the Cube and create a new cube called DST.

Following are the points to keep in mind:

Clearing Animation

Keep the last scene open, select the DST object, and run the clear_animation.py script to clear the selected animation.

Following are the points to keep in mind: