Jump to content
  • Advertisement
Sign in to follow this  
chadmv

My maya x exporter bug

This topic is 4510 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

I've written an X exporter for Maya. All seems to be working fine except for one bug. My test mesh is just a skinned box bending back and forth. When my mesh has skinning and uses one material, everything is fine as shown below: Good However whenever I set any of the faces to another material, some other faces start moving as is they were attached somewhere else on the mesh: Bad In my x file, I have MeshMaterialList { 4; 60; 0, 0, 0, ... When I put all the face indices to the same material index, it works fine. But even if I just change one index, the faces will fly off. All the skin weights and everything else in the x file is the same. Any ideas or suggestions?

Share this post


Link to post
Share on other sites
Advertisement
This template

MeshMaterialList {
4;
60;
0,
0,
0,


says you have 4 subsets in the mesh. Maybe this is a problem? Are all of the 60 attribute buffer elements set to 0 except 1 being set to 1?

How are you loading and rendering the mesh in your DirectX program?

Share this post


Link to post
Share on other sites
I'm viewing the files in DirectX Viewer. My exporter sorts the face indices as well as the list of indices in MaterialList by material. Since this bug occurs with multiple materials, I tried a little experiment. If I don't sort the indices, I still get the bug. If I don't sort the face indices but leave the material mapping indices sorted, I don't get the bug, but my materials are on the wrong faces (obviously). However, if I manually open up the x file and simply reorder the material mapping indices to match their unsorted face indices, the bug returns. The played animation looks like the skin weights are changed. That piece flying off from the bottom of the mesh in the screenshot matches the joint animation of the top joint, it's just reversed. Are the material indices supposed to have an effect on skin weights?

Share this post


Link to post
Share on other sites
I think I solved this problem. I guess DirectX likes data ordered a certain way. So I had to sort all my other data (vertices, normals, tangents, etc.) by material in order to preserve the unsorted order of the vertex indices.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!