Notifications
Clear all

[Closed] Assign random MaterialID

Hi there!

Long time no posting in this section – I married my beloved wife a couple of weeks ago, so other things have been on my mind

What I want to know is how I can assign random material IDs to an Editable Polygon object.

For a big project, I need to create a fairly big randomized cityscape. I decided to use “Greeble” for this.
After generating the the random city, I apply an edit poly modifier on top of the stack and got the top polygons selected (checked “Select Tops” within Greeble modifier).

Now, the interesting part follows…
I want to assign to about 30 to 50 different MaterialIDs to all houses. The tops being selected, I would expand the selection by one step to have all the houses selected. A randomized ID should be assigned to all houses then (30 to 50 different IDs). Every single house should have a specific ID.
To assign another 30 to 50 different IDs to all roofs, the selection expansion needs to be undone and a new assignment has to be made.

The question is, how you guys would to this task.

The idea for this script comes from this thread:
–> http://mattepainting.org/vb/showthread.php?t=3986&highlight=greeble

Any suggestions on this topic would be very helpful.

Thanks in advance!

2 Replies

Check this thread, I was trying exactly the same thing a few weeks ago.

http://forums.cgsociety.org/showthread.php?t=651520

Aye! – This is, what I was looking for.

Thanks!