0
\$\begingroup\$

I followed the instructions on the following video: http://www.youtube.com/watch?v=SissgQ0IXvk

I'm using XNA 4.0 and Blender 2.69

I export the model with animation to a .FBX file.

The animation is a man waving

Here is what it looks like in Blender: enter image description here

And here is how it renders in XNA: enter image description here

The arm where the animation occurs is greatly distorted.

I believe the error occurs in the AnimationPlayer class:

        /// <summary>
    /// Helper used by the Update method to refresh the WorldTransforms data.
    /// </summary>
    public void UpdateWorldTransforms(Matrix rootTransform)
    {
        // Root bone.
        worldTransforms[0] = boneTransforms[0] * rootTransform;

        // Child bones.
        for (int bone = 1; bone < worldTransforms.Length; bone++)
        {
            int parentBone = skinningDataValue.SkeletonHierarchy[bone];

            worldTransforms[bone] = boneTransforms[bone] *
                                         worldTransforms[parentBone];
        }
    }


    /// <summary>
    /// Helper used by the Update method to refresh the SkinTransforms data.
    /// </summary>
    public void UpdateSkinTransforms()
    {
        for (int bone = 0; bone < skinTransforms.Length; bone++)
        {
            skinTransforms[bone] = skinningDataValue.InverseBindPose[bone] *
                                        worldTransforms[bone];
        }
    }

I think the bug can be fixed by editing the code above, I just don't know how to do it. Can somebody help me fix this distortion bug?

Here is a link to the project source code: http://www.mediafire.com/download/ps5ocf1nxbfgrru/SkinningSample_4_0.zip

Here is a link to the Blender file: http://www.mediafire.com/download/vrt8h1p83vkd76g/wave.blend

\$\endgroup\$
0
\$\begingroup\$

Found the problem. XNA's content pipeline doesn't seem to be able to handle animated FBXs correctly. So XNA has a bug. Luckily Blender 2.68a and older has a "fix" for this. Just check "XNA rotation animation hack" when exporting the FBX.

\$\endgroup\$
  • \$\begingroup\$ I will, It says just have I have to wait a few hours before accepting. \$\endgroup\$ – Nathan Jul 13 '14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.