Jump to content

  • Log In with Google      Sign In   
  • Create Account


Skinned mesh incorrectly deformed when using multiple materials


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 cdbfoster   Members   -  Reputation: 102

Like
0Likes
Like

Posted 07 November 2013 - 11:28 AM

Hi there,

 

I am the developer of the DirectX .x exporter addon for Blender, and recently I've encountered an issue that I do not understand.  On a simple skinned mesh in a .x file, when using more than one material index in the MeshMaterialList template, the mesh becomes deformed in a very weird way.

 

The mesh is simply a rhombus composed of two triangles stacked vertically, and contains two bones that each fully influence a tip and share 50% of the influence on the vertices in the middle.  When using only one material in MeshMaterialList, or foregoing the MeshMaterialList template entirely, the mesh deforms correctly.  When instructing the bottom triangle to use a different material than the top, the weird deformation occurs.

 

I've attached two versions of the .x file: one with only one material, and the other with two.  I test the files I export against the DirectX Viewer.

 

Can anyone tell if these files are malformed in some way?  I don't really understand this problem.

 

Thanks for any insight!

Chris

Attached Files

  • Attached File  test.zip   1.66KB   21 downloads


Sponsor:

#2 N.I.B.   Members   -  Reputation: 1021

Like
0Likes
Like

Posted 07 November 2013 - 02:04 PM

Looks OK in my mesh viewer and AssimpView, so the file is fine.

 

What viewer are you using? The old DirectX viewer had some quirks, maybe that's one of them.



#3 cdbfoster   Members   -  Reputation: 102

Like
0Likes
Like

Posted 07 November 2013 - 05:32 PM

Oh really?  Yikes!  So, it doesn't look like this for you?

 

5y9TieO.png

 

If not, can you recommend a better, more up-to-date .x file viewer that would be safe to test my exports against?

 

Thanks a lot for looking into this!

 

Edit:  You mentioned "your" viewer -- might it be prudent to write my own?  Unless there's one out there that could provide helpful diagnostics on malformed files, or something.  I've basically written this whole exporter via trial and error testing against the old viewer (and the occasional spec docs).

 

Edit 2:  If you reverse the material indices such that the first face uses material 0 and the second uses material 1, the DirectX Viewer renders the file correctly... Perhaps all faces that belong to the first material must be listed first, and then the second, and so on..?  A trivial fix if that's the case, but what a weird bug.


Edited by cdbfoster, 07 November 2013 - 05:53 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS