Open eliasdaler opened 1 year ago
Confirmed. When using "Apply modifier", we can't keep mesh instancing, as we don't know if modifiers are the same, and with same parameters. But your case is a special cases, where objects are instanced via collection instances.
I will check if this is something we can detect correctly, and then keep mesh instancing. Setting as enhancement for now
we can't keep mesh instancing, as we don't know if modifiers are the same, and with same parameters.
A naive idea is: if two meshes have same mesh data but have modifiers, insert a "deduping" pass to exporting -- if the two result mesh, after applying modifiers, are exactly same(exactly same vertices, edge, faces...) -- use one of them.
When the object has a modifier, instancing it via group collection still produces multiple meshes even if "Apply Modifiers" checkbox is checked.
Repro:
This is what you get:
The created cube doesn't use "0" mesh, it has its own mesh. Making more collection instances makes even more meshes.
Expected behavior The mesh shouldn't be duplicated in gltf file and should be reused instead.
.blend file/ .gltf Here
Version