We are working on an Iray for Rhino plugin, and I am writing a material conversion routine, to help the user get nice initial materials in Iray. We have written an MDL material explicitly for mapping the Rhino material parameters, to ease this task. We do not expect anyone who wants to use Iray to continue to use the Rhino materials, as these do not expose very much of the power of MDL. Therefore I would like to write a routine to convert the Rhino materials on a one-time basis.
I see that there are two materials in the RhinoObject, RenderMaterial, and Material. Getting the Material parameters converted was easy, but I am having trouble seeing where the RenderMaterial comes into the equation. The only time I ever get the RenderMaterial (i.e. GetRenderMaterial mostly returns null), is when there is no material explicitly assigned.
What would be the best way to handle RenderMaterial, keeping in mind that we just want to convert once?
I am also having trouble mapping some of the parameters. What are the class names for the following UI parameters: gloss finish, and the colour button next to it, Textures>Color? And there is a Shiny parameter in the code that I don’t see in the UI.