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

unhandled

#1

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


(Rob McPherson) #2

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.


#3

Ok Ill try that. Thanks.


(Gustavo Fontana) #4

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


#5

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?


(Pascal Golay) #6

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


#7

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.


(Pascal Golay) #8

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


#9

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?