Assign Materials to Individual Objects Randomly


#1

Hi,

Wondering if anyone has any script (or if I’m missing an existing feature) to render the scene with objects assigned random diffuse colours?

The final render is a rainbow-like (but flat, no reflections/shadows) image making selection of various parts of the scene easier to select in Photoshop with the magic wand tool.

In Keyshot the feature is called a clown pass https://www.keyshot.com/keyshot-rend…-render-layers. I’ve been doing it manually in Vray for years. Sometimes you need individual surfaces to be unique colours to be able to select finer
areas etc. so automating the process isn’t necessarily ideal, but in some complex scenes it would certainly be quicker.

Am I missing such a feature in Rhino? Does anyone know of a script? You’d think you could run a script that says 1. select object #1 2. assign random material (from a pool of say 12 different flat colours) then object+1 and repeat?

Ideally an object beside another isn’t the same colour since if they’re ‘touching’, the selection in Photoshop becomes inaccurate. But if the process is automated to an extent it would save a lot of time.

I suppose the process would not be to dissimilar to this: Assign Objects to Individual Layers

But rather than assign a new layer, it would assign a new colour.


(Declan Halpin) #2

I got a script a few years ago from the newsgroup to randomly assign colors to layers. Not exactly what you’re looking for, but maybe a starting point?RandLayerColor.zip (973 Bytes)


#3

love the rhino forums… I had lost this and simply had to look back here.