Multiple materials/ adding material id's to Surfaces/Solids

Hi, Guys

I have to create a material that’s plastic white on top, blue in the middle, and metallic on the bottom. I am coming from a 3ds max background so for me I would just separate the polygons and assign material id’s,

Im assuming its the same in rhino. I would just split the object and assign each piece an id and then give it the associated material. If that’s the case, then how do I assign the material id’s to the surface/solid. is it on the options panel.

forgive me but im about to head to work and im trying to nip any issues in the bud.

Thanks,
Shawn

Shawn,

I think it’s best to split the model up into pieces based on the different materials, then create a different layer for each material. Change the layer of each object to the relevant layer and then from the materials editor add the correct material to the correct layer. Each material can be assigned a different material id colour. Just make sure you render out the material id channel which can then be accessed by the VFB.

Ok Ill try that. Thanks.

There are no material IDs in Rhino, but there’s a hack command that allows you to assign a material to a single surface of a polysurface.

It does not work with mesh faces, and it does not work with multiple surface selections. Only one surface at a time, and you need an object near by with the desired material you want to assign to this face.

Command is called _TestPerFaceMaterial

Is it just me or the ability to export material ids in the polysurface mesh a must?
If you have an object with curved surfaces and want to export the mesh having it in different surfaces is a problem because meshing would need to be super detailed to avoid gaps between them.
Any chance this is could be addressed in the near future?

Hi Rui - the way to handle this now is to Mesh the object, (i.e. youi get a seamless mesh at joined edges) then hide the polysurface, explode the mesh and apply materials per object from the result. Note you can join disjoint meshes that share a material as well to reduce the number of objects.

-Pascal

Hi,

I refresh this old topic, this is still something we can’t do in rhino 6.

We typically have curved glass objects, which are partly smooth (specular glass), and partly grinded (diffuse glass). To apply two different materials, we need to explode the closed polysurface into two polysurfaces. And then, rendering show gaps between the two surfaces as the tesselation is no longer connected. This is especially a problem with ray-tracer as the gaps will appear black.

The solution from pascal is not working, you can’t explode a mesh where all faces are connected. You only can explode a mesh when it is made of disjoint meshes. The only solution is to extract mesh faces by selecting them, which is a nightmare when the shape is complex. And even if there was a simple solution with meshes, then you can’t edit the object shape with nurbs anymore. Any shape change requires redoing the whole step.

So yes, the ability to set different materials on a polysurface sub elements would be a must. Or, if it is too complicated to implement (as objects can only have 1 material), the possibility to define material IDs (integers) for each sub element would allow other renderers to use it as it is done in 3dsmax for instance.

Hello - this is not the case - a mesh derived from a polysurface should Explode into meshes that correspond to the polysurface faces - if that is not the case, please post an example…

But, in V6 you can sub-object select (Ctrl-Shift click) a face on a polysurface and assign a material to that face. Does that work for you?

-Pascal

Hey thanks! This has fixed a very painful lack of Rhino 5 and older versions that we had for years…

Our exporter plugin does not support that feature yet (it only gets the main material of the polysurface and applies it everywhere). Do you have an idea of the propery we need to use in the C# API for getting the sub-surface materials?

Hello Pascal,


I’m using the last updates from Rhino V6 and Vray next.
I am trying to use your solution, which would fit me perfectly. However, happens, that when I choose to apply material to the selection, as you can see in the screenshot, the command message is “nothing selected” when in fact the surface face is in deed selected, therefore, no material is applied to that face. What should I do?
Thanks
Ricardo

Hi Ricardo -

Which command are you running that gives that feedback?
-wim

Exactly as Pascal described… “(Ctrl-Shift click) a face on a polysurface and assign a material to that face”, then right click over VRay material -> apply to selection…
Thanks

Hi Ricardo -
Have you tried this without V-Ray?
This is what I do and see here:


-wim

2 Likes

Thank you!

On that way, as you example works. I was using the same method, however, through the V-Ray Asset editor, and through that that function was giving me this bug…

This solution saves me lots work!

Best regards,

Ricardo A.

Hi Ricardo -

In that case, you will have to take this up with the support people at Chaos Group.
-wim