Running headless, the copy of the RH.Material yields null when passed to RenderMaterial.FromMaterial(material, Doc), which results the conversion throwing since the following calls assume a non nullable Material.
Changes:
I have tried to make the minimum intervention.
Check if headless, and if so do not use the copy of the material but the original.
Description & motivation
Running headless, the copy of the RH.Material yields null when passed to RenderMaterial.FromMaterial(material, Doc), which results the conversion throwing since the following calls assume a non nullable Material.
Changes:
I have tried to make the minimum intervention.
Screenshots:
Before and after 💯
References
https://developer.rhino3d.com/api/rhinocommon/rhino.render.rendermaterial/frommaterial