I’m trying to convert a Rhino material read from a external file using Rhino.FileIO.File3dm.Read(filePath) using Rhinocommon.
I can’t figure out any way to convert this from original Rhino materials in the File3dm (in memory) to a RenderMaterial, in order to add it in the active document.
I have tried using materials RenderMaterial property: I certainly can obtain a renderMaterial object, but once added to the document’s renderMaterialTable, it happens that it is no more a PBR material, as it originally was.
Is this a bug or is something expected to happen?
Has anyone tried to import a PBR material from a external file using Rhinocommon?
Please, can anyone have a look to this one? Is it there any chance to expect that renderMaterial property from material will respect the “material type”?
thanks
OK -you should now be able to call RenderMaterial.CreateBasicMaterial and, if the incoming material is a PBR material, the resulting RenderMaterial will be a Physically Based material.