Jump to content

Blender exporter changes adds vertices


ozRocker
 Share

Recommended Posts

In Blender I have 2 copies of a mesh.  One of them has been warped but the vertex count is the same.  They both say 7,405 vertices in Blender.

When I export to .babylon file one mesh has 9,350 vertices and the other has 9,352 vertices. I'm trying out the new morph manager and the meshes need the exact same number of vertices.  How can I make the Blender exporter consistent?

Link to comment
Share on other sites

You might edit line 297 of mesh.py, once it is unzipped.  Add an addition test which will never be true.  This will turn off vertex optimization, so count will not change, but it will get very large, basically # of triangles * 3.  This assumes only 1 material.  There will be border triangles if multi-materials. eg.

alreadySaved = alreadySavedVertices[vertex_index] and not useFlatShading and 3 == 4

 

Link to comment
Share on other sites

28 minutes ago, JCPalmer said:

You might edit line 297 of mesh.py, once it is unzipped.  Add an addition test which will never be true.  This will turn off vertex optimization, so count will not change, but it will get very large, basically # of triangles * 3.  This assumes only 1 material.  There will be border triangles if multi-materials. eg.


alreadySaved = alreadySavedVertices[vertex_index] and not useFlatShading and 3 == 4

 

ok cool.  Well I solved it for now by exporting as an OBJ and using the OBJ loader.

Do you think there'd be a way to apply the same optimisation to multiple meshes?  It would be neat if you could group a bunch of meshes together so the same optimisation is applied to all.  I don't have a great understanding of this though so maybe its not possible.

Link to comment
Share on other sites

The direct answer to your question is no.  If you have any change such that a vertex somehow no longer matches across triangle with respect to normal /UV/vertex colors/matrix weight or matrix indices, then in one export you will get a mis-match in vertex count.

In about a month, I will ported some of the stuff I will be doing for shapekeys.  There the vertices are set as normal.  The shapekeys are mapped into the same order.  This issue exists, because you are jumping the gun and bleeding accordingly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...