Exporter changing vert order of original mesh after export

I’m using the babylon exporter to convert .max files to glb for use on the hololens. They export fine and look like they should, but the source mesh is getting the vert order scrambled causing errors in the original mesh. This seems to affect cylinders only as far as I can tell. I have opened meshes after exporting to find collapsed faces or extra verts that weren’t in the mesh when I exported. (i.e. cylinder has 18 sides, 18 verts. Post export it will have 20 - 25 verts in random positions.) All of the source meshes look like the following image after export. The exports themselves are fine, but the source meshes are getting mangled.

Adding @PatrickRyan

This is because the 18 verts in max are only from a position standpoint. In Max, a mesh can 18 vertices for positions but20 vertices for normal or texture coordinates.

As vertex are atomic entities in gltf, we have to gather the bigger version and then if they are 20 vertices because of normals then the gltf file will have 20 vertices.

The scrambled data can perhaps be fixed with reset X-form / Collapse

@lorenzo, is there any way you can share your max file with us? I did a quick file export with 18-sided cylinders and I did not see any change in the original mesh. I’d like to see what is in your stack on these meshes to see what might be going on. Thanks!

I can share the mangled mesh with you, I had accidentally left auto-save max file checked and it saved over the original file. I’m not entirely certain, but the testing I’ve done, it looks like if you leave a primitive in the stack and export without collapsing, this will happen. I’m going to test some more today and I’ll follow up if I find anything. In the mean time, here’s my broken max file.

Edit: I can’t upload the file. I get a message that new users can’t upload attachments, so here’s a dropbox link. I’ve included two meshes, the one pictured in my original post, and another that has a similar cylinder issue. It has been suggested that this may be due to 3DS Max using a left-hand coordinate system, but so far this only seems to affect cylinders, so I’m not certain.

@Lorenzo, thanks for the files. I know that you will be able to post files once your probationary status for a new account wears off, I am just not sure how long that is on discourse. I will look into the file and let you know what I find. Thanks!

@Lorenzo, I looked into the files, and in Max 2019 with the latest babylon exporter, I am not able to repro your problem with your files:

This is the file after exporting where the cylinders are still intact with the edit poly modifier.

And the exported glb in the sandbox

I am agree with your assessment that this may be due to the edit poly modifier in the stack on a primitive, but the Babylon exporter does not do anything but look at the top of the stack and does not modify the stack in any way. Which version of Max are you running? And which version of the Babylon exporter do you have installed?

First step would be to update the exporter to see if that has any affect on the issue you are seeing, but it may also be worth updating Max if you are able to. Let me know if any of that helps the issue because we certainly shouldn’t be able to touch the stack of a mesh in Max.

1 Like

Currently I’m running Max 2017, and the Babylon Exporter version is 1.3.32, which appears to be the most recent. I’ll keep trying to replicated this and let you guys know if I find anything. Thanks for the help!

1 Like