I use IGame to export the skeleton, but have some questions. I want to calculate the binding position with the skeleton. The function with
IGameSkin->GetInitBoneTM(IGameNode * boneNode, GMatrix &intMat)
can get the bone TM when skin was added. But it will return false the the param is root bone. There is another function
GetInitSkinTM(GMatrix & intMat)
in IGameSkin. But it always return a Identity matrix. So how can I get the binding position with root bone?
If GetInitBoneTM() returns false, then it suggests that the bone is not actually used by the skinned mesh.
The GetInitSkinTM() function returns the transform that was applied to the skin geometry at the time that it was bound to the skeleton, and not the transform of any particular bone.
If you'd like to see an example of skin/skeleton exporting from Max (but without using the IGame interface), take a look at the source for the OpenGEX exporter:
The skin and bone bind transforms are exported at the top of the OpenGexExport::ExportSkin() function.