Hello,
When I export gltf I’d like to preserve material names but they seem to disappear:
image.png (5.2 KB)
See the spec: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#metallic-roughness-material
image.png (1.2 KB)
Could material name be added, or is there an option I am missing?
See following unit test:
[Test]
public void Gltf_supports_material_names()
{
Scene scene = new Scene();
scene.RootNode.CreateChildNode("SomeCube", new Box(10,10,10).ToMesh(), new PbrMaterial(Color.Red)
{
Name = "RedMaterial"
});
string gltfContent;
using (var ms = new MemoryStream())
{
scene.Save(ms, new GltfSaveOptions(FileFormat.GLTF2)
{
PrettyPrint = true,
SaveExtras = true,
});
ms.Seek(0, SeekOrigin.Begin);
using (var sr = new StreamReader(ms))
gltfContent = sr.ReadToEnd();
}
Assert.True(gltfContent.Contains("RedMaterial"));
}