Is it possible to script the application of a material on à rhino object?

Hi Rhino’s fans

Is it possible to script the application of a material on a rhino object?
I needs to render automatically a ring with a lot of different material : gold, silver, platinum etc…
Is it possible with basic scripting of rhino (command lines) ot I have to investigate RDK in python ot C#?
Thanks in advance for your help.
Philippe PIGEARD

What is scriptable with “command lines” is whatever you could normally do with Rhino commands. But materials will be difficult. You can get to:

Material  Library  Color  GlossColor  GlossFinish  Transparency  TextureMap  TransparencyMap  BumpMap  EnvironmentMap  Match

via

-Properties Material Object

but if you try to get to “Library” it goes nowhere… As far as I can tell, getting a material from a library is not possible (even with normal Rhino commands), so I don’t think you have much hope here.

If you have a blank file pre-set up with materials, then it becomes more possible using RhinoCommon - you can first import the file, which will import the materials… If you have made sure that the materials have unique names - and that nobody creates new materials in the file with the same name - you can dive into the material table and grab the name, find its material index and assign that to the object. It’s not all that simple, though…

Dealing with scripting and materials in Rhino is probably one of the poorer experiences I have had on recent projects… I wish I had better things to say about it… Maybe I’m just too dense to understand it all.

From what I understood, the only reliable way to deal with this is to use the RDK SDK.

–Mitch

If you are using Maxwell Render, you can use Grasshopper and Scarab.

Thanks but what is Scarab?

PS : I use ARION for Rhino http://www.randomcontrol.com/

Scarab is an add-on for Grasshopper that exposes the Maxwell Render plugin (and V-Ray in the future) to the scripting environment of Grasshopper.

With Arion this doen’t help, though.

Thanks