Export Animations to DirectX with Multiple bone chains

Hello,

I am trying to export all chains of bones from one armature to DirectX format.

This is an original script from:

http://development.mindfloaters.de/DirectX_Exporter_Mod.8.0.html

I add few lines to this file (from line 563). Let’s do the export for all chains of bones:


...
root_bon = amt.getBones()

# this FrameBlock should be placed in cycle 
for bone in range(len(root_bon)):
  if not root_bon[bone].hasParent():
  mat_r = self.getCombineMatrix(root_bon[bone])
  name_r = root_bon[bone].getName()
  self.openFrameBlock(mat_r, name_r) # opens "Frame {"
  self.writeListOfChildrens(root_bon[bone])
  self.closeBlock()
# end of cycle 

self.exportMesh(obj, armatures[i])
...

But there is a problem with FrameTransformMatrix in the exported .X file.

Does anybody can help?

I will be very appreciated for your helpl as well as many,many Blender users.

Could this be related to
http://projects.blender.org/tracker/index.php?func=detail&aid=2230&group_id=9&atid=125

If it uses ‘getRestMatrix’, its probably been broken for a while.

Thanks, Vek.

In the output DirectX file I found a problem with animation. This is because AnimationKey {…} transformation matrix is wrong.

Does anybody know is this transformation matrix shoud be in world system for each bode, or it should be relatively computed from parent bone?

The script http://development.mindfloaters.de/DirectX_Exporter_Mod.8.0.html

uses getRestMatrix (), i.e. “world” coordinate space.

So probably in section AnimationKey should be used getRestMatrix(‘bonespace’) ?

Also does anybody know is DirectX AnimationKey translation matrix works in worldspace or in bonespace, i.e. is it relative to the parent bone or not?

Thank you very much for help,
Konst