Jump to content
  • Advertisement
Sign in to follow this  
BCullis

.x animation export setup?

This topic is 3669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If this is more fitting in the art subforum, I apologize. I might just be trying with incorrectly-phrased searches, but I don't seem to be coming up with much so I thought I'd field the question here. When working with .x animations, how does one structure the model file for export? I'm aware most 3d modeling programs have a timeline window, and you can have animations on separate "layers" if you wish, or just tack them back-to-back on the same timeline. How, then, does .x work with the animation portion of the exported .x file? Do you string all animations together and then reference (frame[20]-frame[100]) for animation "death"? Or do you do multiple exports, one per animation? No urgency on this of course, just generally curious right now. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
One of the first things you should do is to take a look (in any ascii editor) at one or more animation x-files - e.g., tiny.x.

In general, common animation x-files are organized as:

- templates (not always necessary if you're going to be doing a custom import)
All the applicable templates can be found in the SDK (look for 'x file templates')

- frames
Or, interchangebly, "bones." Essentially nested SRT (scale-rotation-translation) information in vector or matrix form.

- mesh
Usually a set of vertices, normals, texture coordinates, etc., along with index arrays as applicable. There may be one or more meshes, parented to one or more frames. For each animated mesh, there will be a set of skinweights, describing the vertices which each bone influences and by "how much."

- animation set(s)
Following the frame structure (containing one or more meshes) are one or more animation sets, named or unnamed. These are just listed serially, one after the other.

Each animation set has a set of animations, one for each bone that has vertex influences or is the parent to a bone which has vertex influences. Each animation (usually) has a bone reference, timing and SRT data (for each time reference). The SRT data is what is "lerped" to form a smooth animation.

When an animation x-file is imported (let's assume D3DXLoadHierarchyFromX), one of the objects created is an AnimationController, which handles advancing the frame time, switching or blending animation sets, etc.

Animation x-files can contain as many separate animation sets as you'd like. If you're clever, you can import several animation files separately and "transfer" an animation set from one hierarchy to another. However, overall, it's easier to combine all the required animation sets in one file.

Share this post


Link to post
Share on other sites
I would advise you not to use the .X file format...its a headache to use and a nightmare if you want the animation to be exported correctly from any of your favorite modeling programs(for maya theres cvexport or something like that which doesn't work, I believe 3ds max natively exports to .X (still it screws the skeletal animation)

If you have the time devise your own file format for animations(as I am doing) or use MD3/MD5 file formats.

Cheers

Share this post


Link to post
Share on other sites
X format supports custom data ... so you should not have to reinvent entire format just to pass some custom data.

However problem with X format is that allmost all FREE exporters seem to be dead. There are free exporters for Studio MAX and also solutions like Okino and deep exploration, but those costs money (max has free exporter, but Max itself is expensive). If one wants to go legal and for free, blender seems to be the only working solution at the time. But who knows how to use blender? :)

But if you are going to make own custom file format, then you are at same square anyway ... :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!