Tuesday, February 13, 2007

What is Default XNA Importer doing for .X?

XNA Framework and Managed DirectX have big difference about animation control. Some helpful methods of MDX were removed in XNA. So it became difficult to implement skin mesh animations quickly. Perhaps, the reason why XNA doesn't have these helpful methods is that most of games have unique animation process.

Here is "Managed DirectX 1.1 to XNA Framework (Beta)". This document shows that all features about meshes and animation were not implemented in XNA. This spec is smart and excellent, but it addles not only MDX developers but D9X developers also.

For standard process, animation components library already has been released.

But, developers have to understand XNA and implement skin mesh. I hear that the default .X importer in XNA does import only basic parts of a model. Does it not import hierarchies and a weights?

Bones, weights and hierarchies are important. If developers take a method to divide animation data from .X, importer doesn't need to import animation data. The default importer may be enough spec in this case.

It's important to research the spec of the default .X importer. I began it. My search procedure was the following;
  1. Program a simple model viewer with the default .X importer which makes a Model class instance.
  2. Load Mr,Tiny having animations. And, break in the process.
  3. Check a data by debugger's viewer.
I got the following results by that.
  • 49 Bones and 1 Mesh. But, tiny.X defines only 48 frames. This is meaning that the default importer defines a new bone.
  • Bones keep their name, their offset transform matrix and correct hierarchies.
  • The mesh is tied with Bone[3] which is the fourth frame, but tiny.x defines the mesh inside the third frame. In other words, the default importer makes a new bone when it encounters a mesh.
  • The new mesh is a child of the third frame.
Perhaps, it's possible to implement a simple animation (not skin mesh) without vertex weights by only the default importer, if this importer can import sub meshes.. Of course, nobody wants to do it.

No comments: