OK guys
try picking apart a MoCap data format importer...like asfIn.mel (imports asf data into maya). Sounds like you're pretty much trying to do the same thing,but build a skeleton too. I'll upload readHTR.mel to the MEL scripts section, which is Mel script for importing MoCap data from a MotionAnalysis .htr file. It builds a skeleton too.
Motion capture data is nasty, but it's not like you can ignore the stuff so here are some of my findings with exporting my project's own skeletal heirarchy. I also wholeheartedly agree with the previous post - try digging through a script that has already been implemented. The asf script is a good one for that, as it's what I glanced at a couple of times for hints.
The foremost problem with joint angles is the rotation order. You can have a skeleton that looks juuuust about right, but one of the bones moves a strange way because the joint's rotation order is not right. Be careful with rotation orders though - one programs' xyz can be another program's yzx. This is often due to internal order of matrix multiplications and quaternion rotation representations and all kinds of other stuff I don't really understand. Anyways, try to get those joint rotations right. I did it through inspired trial and error grin.
Another problem you may run into is relative versus global rotations - make sure all joints in the skeleton are oriented relative to their previous joint and that what creates the joint has the relative flag turned on. Actually, here are two lines I use to create the hips and the next joint respectively:
[
joint -name ant_Hips -position 0 0 0 -rotationOrder yxz -dof "xyz" -orientation 0 0 0;
select -r ant_Hips;
joint -name ant_LeftHip -relative -position 0.127713 0.00369902 -0.000653304 -rotationOrder yxz -dof "xyz" -orientation 0 0 0;
]
See how I select the prior joint and then create the second one in a 'relative' manner? Yesh... Good luck - it's always tough stuff but I can assure you, as your intuition probably is telling you, maya -can- display your motions - it just takes a lot of massaging.
Andrew Gardner
University of Wisconsin, Madison