Vertex count when exporting from 3ds Max

I have a project with hundreds of models generated in 3ds Max, exported to glb and then imported into Babylon. The idea is to use morphing as transition between individual models, which requires all models to have the exact same vertex count.

In 3ds Max, they all have exactly 2964 vertices and 5924 faces. But when I export to glb they all vary between 3316 and 3341 vertices, so morphing is not working

I have tried both Babylons 3ds Max Exporter and the native glb exporter in 3ds Max, with the same result.

The only solution I have found so far is setting “Quick Export” in the Babylon Exporter, which then exports every model with exactly 17772 vertices, but that unfortunately quadruples the file size. (390mb in total, vs 90mb without “Quick Export”)

Is there another way to maintain the same vertex count when exporting?

@PatrickRyan might be able to help.

@Boye, I haven’t seen this particular issue in the past. Are you exporting morphs with an active stack or have all the mesh stacks been collapsed? Also, are your morph targets working in Max correctly before export? You definitly shouldn’t use quick export as the exporter does not take the optimization step needed to reduce duplicate vertices. However, if all of your morph targets are based off of the same triangle list, the optimizations shouldn’t produce different results from one morph target to another.

@PatrickRyan Thanks for replying

I was exporting with an active stack, but it’s the same when collapsed to Editable_Poly or Editable_Mesh

Morphing works correctly in Max before exporting.

I have found another fix, which is splitting the edge (created with Shell modifier) into a separate mesh. This creates two meshes with consistently 2964 and 300 vertices across all models

1 Like

I still can’t explain why, but i think I have found the cause

Removing UVW Map from the models somehow solves the issue

1 Like

@Boye, I can possibly answer the why. If you have a UV map on a mesh, every UV seam will split vertices. And by glTF specification, all UV seams are unwelded when saved. In practice this doesn’t matter much as the baked normal on the vertex won’t show a lighting artifact, and you will likely only see the split seam if you are doing vertex displacement. This is an optimization since the format is a runtime format and not meant as a format to share files for editing. This is likely why you are seeing a difference in vertex count on export.

2 Likes

I think that makes sense - Thanks!

1 Like