Stepping Through The Animation
timeline.
Normally when you write an exporter, you try
to ensure that you only output transforms that have an affect
on your final model.
This implies that before you write any transform
or animation data to the file, you must have first determine
a set of transforms to write to the file.
Usually this list of important transforms will
be held as an MDagPathArray. MObjects unfortunately can become
invalidated when the frame changes, so generally storing DagPaths
is the way to go.
To output the animation we can use the MAnimControl
class once again to step between the first and last frames.
Each frame we can sample the joints transform and output it.
This example simply outputs the rotation, however you could
also output the translation and scale for the joints.
|