Gltf-blender-io: Increased vertex counts when mesh has UVs

Created on 24 Jul 2018  路  15Comments  路  Source: KhronosGroup/glTF-Blender-IO

Okay so I have:

nevtelen

vertices.

After export:
nevtelen2

28k

Mesh_&_Object ReTest with master bug exporter

Most helpful comment

In the left sidebar change shading to "smooth" and you should see the expected vertex count:

screen shot 2018-07-24 at 9 29 37 am

With flat shading, vertices must be duplicated to maintain hard edges. Alternatively, select "smooth" shading in Blender but disable normals in export settings. Viewers will calculate normals for flat shading automatically in that case.

All 15 comments

In the left sidebar change shading to "smooth" and you should see the expected vertex count:

screen shot 2018-07-24 at 9 29 37 am

With flat shading, vertices must be duplicated to maintain hard edges. Alternatively, select "smooth" shading in Blender but disable normals in export settings. Viewers will calculate normals for flat shading automatically in that case.

Thank you :D

@donmccurdy
Ehm.. I tested it. I still have 28k vertices :(

My test case here was to add the default monkey mesh, select smooth shading, and immediately export, which gives 507 vertices before and after export:

Archive.zip

Note that the Auto Smooth option is not the one you want. Could you share a .blend file if you're still seeing the issue?

@donmccurdy see this:
untitled.zip

Please tell me if it is working for you.

Hm, there are other conditions that would affect vertex count like applying modifiers before export but I don't see an obvious reason here. Will have to look into this one more.

I am trying to figure out this but I have no clue what is different from my mesh and a simple cube structure... I could reduce the vertex count with edges->clear sharp, but still way far from the expected result.

Confirmed this is a bug. When the model has UVs, some logic here...

https://github.com/KhronosGroup/glTF-Blender-Exporter/blob/master/scripts/addons/io_scene_gltf2/gltf2_extract.py#L758-L774

...will split vertices based on some UV and tangent-related comparisons, even if export of UV and tangents is disabled. That might be correct if the user wants to export UVs and tangents, but I can't see any reason to do those checks if not. If I comment that bit out, I get the expected vertex count.

@donmccurdy thank you for checking !
Tried to comment out me too but still not the expected. It's 16k but the expected is 10k. That +5k matters a lot.

Here's the patch from my test earlier:

vertcount.patch.zip

It isn't really the right solution, but does avoid extra vertices. The fix will likely require a closer look at what's happening.

Thanks for this, but after installing it still export 28k for me, maybe I installed it wrong ? here is my gltf2_extract.py:

nevtelen

The other thing is that you may disable the weight export with the patch, which is bad because I will need it later.

Transferring this issue to the new repository (https://github.com/KhronosGroup/glTF-Blender-IO), where I've confirmed the number of vertices (even with normals+tangents disabled) is still too high.

@donmccurdy Can you check if this is fixed?

I can confirm that when I disabled UV, normals and tangents, I now get 10500 vertices.
Think we can closed this ticket.
Don't hesitate to comment / reopen if you still think there is an issue

Was this page helpful?
0 / 5 - 0 ratings