Sign in to follow this  
chillypacman

Issue with animated .x files and multiple materials

Recommended Posts

chillypacman    100
ve been trying to export skinned and animated .x models with multiple materials on the same mesh but have found the skinning breaks when that happens. The animations work fine but the mesh stops wrapping around the bones properly (it seems) with what looks to be different vertices attaching themselves to different bones causing a strange mess. When only one material is attached to the entire mesh it looks fine: http://imgur.com/KSV0w However when two are attached it goes all nuts: http://imgur.com/l4PwI Not sur eif this is relevant but when I changed the material of a single triangle on the left side the entire left side of the model became garbled as you can see in the screenshot, however the right side was fine. When I changed the material of another triangle on the right side it all became garbled. I'm using the pandasoft DirectX exporter, I've also trid KW-Xport

Share this post


Link to post
Share on other sites
Buckeye    10747
It sounds like it's likely a problem with your modeling program and not DirectX.

However, it may be a problem with the app you're using to display the mesh. It may not handle multiple skinned subsets correctly. Do you have Microsoft's MeshViewer? If so, use that to display your file. If not, get a copy. If it's still garbled, the problem lies with your modeler. If it displays properly, the problem is the program you're using to view the animation.

If you have an ASCII copy of the x-file, there's another test you can try to narrow down the problem. Save a copy of the original x-file. Open the copy of the x-file in an ASCII editor. Notepad++, or some editor that highlights matching brackets, is best.

At the end of the file, delete all the animation information. I.e., starting with the first line of the animation - "Animation {" - delete everything to the end of the file.

In the Mesh object, delete the MeshMaterialList (includes a list of face indices and a list of materials), the XSkinMeshHeader and all the SkinWeights. Those are all bracketed objects. Be careful to delete only the object name, the info between matching brackets and the brackets themselves.

Display the edited file. If it displays a proper static gray mesh, the problem is with the skinweights - either the way your display program handles them, or the way your modeler exports them.

Share this post


Link to post
Share on other sites
chillypacman    100
Hmm, I'm using the directx mesh viewer and have tried it on multiple computers, same effect on all of them. Given what you have said I am now strongly suspecting that it's the exporters which are failing, either because my settings are wrong in the exporter (unlikely as I've tried an ungodly number of combinations) or simply because the exporter cannot handle it.


I use 3D studio max with pandasoft directx exporter, not sure if this is some sort of documented issue.


Thanks for your advice, I'll try it when I get the chance :)

Share this post


Link to post
Share on other sites
Buckeye    10747
CORRECTION:
Sorry about this. Part of my last post should read:
Quote:
..starting with the first line of the animation(s) - "Animation Set {" - delete everything to the end of the file.


Another thing that would be quicker: export a single material animated x-file and a multi-material animated x-file. Open the two files in an ASCII editor and compare the SkinWeights information for several bones. They should be identical. The only difference should be a change in the MeshMaterialList attributes (for the faces having different materials) and one or more additional Material objects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this