Change material id


Is there is a rhinoCommon function to change material id ?

Hi Tom,

Why do you need to change a material’s id? What problem are you trying to solve?

– Dale

For instance I have a series of objects let say boxes.

I would like to randomly assign two materials for them, so that some of them would have one material and other second material.

Now I am doing differently, just grouping objects into separate groups and assigning material for each group.

Instead of this I would like to change their ID and use vray to create multi-map.

In grasshopper I was able to map texture , change mapping and I see that by default in rhinocommon material id for all objects is 1. I wondering if it is possible to change?

Rhino.RhinoDoc.ActiveDoc.Objects.ModifyTextureMapping(guid[i], 1, textureMapping);

@matt_newberg, is this V-Ray question something you can help with?

The multi material that you are using only work with proxy object and the ID is not a material ID it is Object IDs.
In V3 We do have the ability to setup object IDs and we also have a multisub texture. This two features allows you to do what you are looking for.

Hi Tom,

I have the same problem with Octane render for Rhino. I can randomize the textures of Instances (from one single Block) and it works good. But to do the same thing to different objects, I need to assign different materials ID. It could be good to me also if i can do it by Grasshopper.
Could you Help me?
Thanks, regards,