In CPython, try exporting glTF with the latest rhinocommon

I am tring to exporting glTF format in CPython with rhinoinside,but i encounter an issue: if i setting the property:Gltfoptions.ExportMaterials equal to False,it can be work.But if I need to export the material, the conversion will not be successful.There is no doubt that I need materials, can this problem be solved?
there is the code:

import rhinoinside
rhinoinside.load()

import Rhino


path = r"C:\Users\62687\Desktop\TestDoc\block.3dm"
doc = Rhino.RhinoDoc.OpenHeadless(path)

Rhino.RhinoDoc.ActiveDoc = doc
the_doc = Rhino.RhinoDoc.ActiveDoc

path_to = r"C:\Users\62687\Desktop\TestDoc\block.gltf"
Gltfoptions = Rhino.FileIO.FileGltfWriteOptions()

Gltfoptions.ExportMaterials = False # default value is True, export will fail

is_done = Rhino.FileIO.FileGltf.Write(path_to, the_doc, Gltfoptions)

print(is_done)

@dale

@Joshua_Kennedy - is this something you can help with?

The reason has been found: the material for glTF must be PBR, so the material needs to be converted to PBR material before exporting.

Thank you for your reply!!!

This shouldn’t fail. Custom materials are converted to PBR on the fly when exporting to glTF. When running Rhino normally this works as expected. For some reason I haven’t worked out yet it’s failing with Rhino.Inside. I logged a bug here.

It indeed seems to be a bug. I can export successfully when I leave the material color as default, but it fails again when I change the color.

For a PBR or Custom Material?

Custom Material