specklesystems / speckle-sharp

.NET SDK, Schema and Connectors: Revit, Rhino, Grasshopper, Dynamo, ETABS, AutoCAD, Civil3D & more.
https://speckle.systems
Apache License 2.0
370 stars 170 forks source link

fix: if headless use original material #3511

Closed vwnd closed 2 months ago

vwnd commented 3 months ago

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 💯

image

References

https://developer.rhino3d.com/api/rhinocommon/rhino.render.rendermaterial/frommaterial