GLTF output generates redundant materials

I’m seeing redundant materials being output into GLTF files. To reproduce:

-create a scene
-create a single material with a simple color, give it a name
-create 10 nodes, each with a single mesh, and each node using that same material instance you created above
-save the scene to GLTF
-open the GLTF in a json editor
-You’ll see in the “materials” section 10 identical materials, all with the name you supplied above
-Each mesh will have a “material” json propery pointing to its own copy of the material, i.e. 0, 1, 2, …

My application has to create a large number of small meshes, but all using the same material. I tried adding that material instance to the Scene.Library but that did not prevent de-duping.

Is there some other way to register the materials with the scene to make sure they don’t get duplicated? These dupes are really blowing up my gltf file size.

@seamless.devs

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): THREEDNET-1561

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.