Skinning data in maya is stored in
MFn::kSkinClusterFilter nodes. You will have probably noticed,
that the hyper-graph display has become fairly complicated, but
don't fear, accessing the data is made simple by the MFnSkinCluster
function set.
The skin cluster basically takes
two inputs, the bone hierarchy and an undeformed mesh shape. The
original mesh "meshShape1Orig" is tweaked by
the skin cluster to output the deformed mesh "meshShape".
The undeformed surface shape essentially
holds surface information from when the surface was bound to the
skeleton. It may at first seem sensible to get the bind pose information
from "meshShape1Orig". This however is generally
a bad idea because modellers and animators often make small tweaks
to the mesh after it has been bound. By accessing the original
mesh you will lose any of those tweaks.
Instead, it is better to set all
meshes back to their bind pose and read the data in that position.
There may however be one or two small problems with this. If the
model uses IK, then the IK will actualy prevent you from going
back to the bind pose.
It is therefore a good idea to disable
IK before exporting, and then re-enable before exporting animation
data. Luckily there are a couple of mel commands we can execute
to do this :
doEnableNodeItems false all
doEnableNodeItems true all
The other problem is that if any
other deformer types (eg FFD's) are influencing the surface shape,
then we will not get back the original geometry, but the deformed
version. We should therefore ensure that all deformers are also
disabled when accessing the bind pose.
|