How to Export Multiple Animations to DirectX

I have altered the “Export to DirectX” script that comes with Blender so that all animations (with fake users) are exported with the skinned mesh. I am having a problem, however, that isn’t necessarily related to the new script.

The problem arises when trying to transition between animation sets during gameplay( in DirectX application ). My methods are perfectly accurate as far as coding DirectX…the problem is with the armature transformation matrices (from the exported X file ). During certain transitions( NOT ALL ), the scaling becomes incorrect. The object appears to shrink ( along the x-axis in the most recent case ). The shrinking increases until the transition reaches 50%. Afterwards, the object returns to the correct scale. In this case, the scaling is always 100% along x,y,z. I’ve watched the transformation matrices in debug and find no inconsistencies. Some of the objects that shrink are not rotated, so, I can compare the “shrunken” values with the “non-shrunken” values and see that the transformation matrix of that object is correct…

What I’ve noticed about the “Export to DirectX” script is that the armature transformation matrices are taken from the current animation set’s bone transforms…so the “original transforms” are those of the first animation set. The location, scale, and rotation values of an animation set are not relative to the object’s original transformation…

Also, after exporting different combinations of animation sets, I can tell that the problem does not always occur during the transition between the same two animation sets. The problem is dependent on: 1. the order of animation sets in the file, or 2. the original transformations of the armature.

Any ideas or experience with this problem would be greatly appreciated!