Randomly assign colors to "class IDs" from connectivity node

   5759   2   1
User Avatar
Member
16 posts
Joined: Jan. 2016
Offline
Hi

I want to assign random colors on a massive city block mesh from Maya.
I used “Connectivity” node and I can see now each building has a unique class IDs.
How can I assign three or four colors on each unique IDs randomly?
I Maya, I can separate mesh from a combined mesh, can I do something similar in Houdini?

I can select each building by “Group by expression” node. I used “@class == 1023” or “@class < 1000”
how can I use vex to randomly select a range of class IDs?

I tried to use “Group by range” node to select points, than expend selection to the entire building. I was able to create three sets of color on the city block mesh, but it doesn't feel randomly enough. Here I have a image to show you what I did in Maya, and I would like to get a similar result in Houdini.

Thanks for spending time and help me to look into this

Attachments:
Screenshot at 2020-05-01 22-26-17.png (967.3 KB)
Screenshot at 2020-05-01 23-03-01.png (643.4 KB)

User Avatar
Member
9417 posts
Joined: July 2007
Offline
plenty of ways
here is for example simple way without any code
just Connectivity, Attribute Randomize and Color SOP

Attachments:
ts_random_color_per_piece_no_code.hip (131.1 KB)

Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
16 posts
Joined: Jan. 2016
Offline
Thank you so much Tomas, that's exactly what I am looking for!

Attachments:
Screenshot at 2020-05-02 09-42-06.png (489.3 KB)

  • Quick Links