Hi!
Has anyone figured this one? There is clearly an option for material and object ID under the render settings and also in the render window. But how to set these?
Hi!
Has anyone figured this one? There is clearly an option for material and object ID under the render settings and also in the render window. But how to set these?
Make sure you are on at least Rhino 8.6
Note though that what you see in the render window is a visualization of the data. When you save it out as EXR you’ll find that the data for the IDs is a number between 0 and 32676 (integers cast as floats). Check in GIMP or Blender as EXR viewers to see the values.
You can load this into Blender for instance to do compositing.
Thanks Nathan!
I will give it a stab. Didn`t know about the EXR format till today I was just used to using the material ID approach in VRay, where you can set an ID (integer or colour) for an object or material.
Are the IDs in Rhino assigned automatically or is there any way to adjust them?
Petr
Unfortunately there is currently no way to assign or control these. They are calculated based on object id and material instance id. So indeed, at the moment these are automatically assigned.
How do I get the numbers for the Material ID in GIMP? How do I make them useful for compositing in GIMP or Photoshop?
You can check my video on how to use these. In the video I use Blender, but for GIMP it will be in a similar way. Just make sure you have the material IDs channel saved as an EXR file.
Addendum:
In GIMP you’d open the EXR file with the material IDs. Then you can use the selection tool (by color) to select the objects with the material you want to create a mask for. From the selection you can create a path so you can always use that to reselect the parts you need to edit, or create masks for (example files at the end of this post).
Steps:
Create your model, assign materials, then render. Save the actual render as a PNG, the material IDs channel as EXR
Open both the EXR and PNG, merge them to be in the same image on separate layers
But make sure that the EXR is the top layer, with opacity set to 0%
With the EXR layer active use Selection Tools > By Color Select
And select one (or more objects). With the EXR being the active and top layer the colors in that will be used to make the selection
Then do Select > To Path
This will create a new path, which you can find in the Paths window
Do this for all objects you want to edit
Then add layers, use the paths to make selections and do strokes as you wish. Here some simple edits with the selection created based on the material IDs.
I’ve attached the GIMP edit file so you can check the things I did:
mat_ids_3boxes.xcf (895.1 KB)
And the 3boxes 3dm file:
3boxes.3dm (2.8 MB)
P.S. note that I added three different materials to the objects to ensure that they get different material IDs, even though they render visually the same.