[Closed] Maxscript idea – Roof Tile automator
I posted this previously on the Challenge thread, but it doesn’t look like anyone has seen it. Sorry for the repost:
Maxscript idea – Roof Tile automator
Hey you Maxscripters! At my studio, we do a lot of buildings with tile roofs, especially S-tile or Spanish style roofs. We usually do this in 1 of 2 ways, depending on the time we have, and the level of detail we are going for.
Creating the roof slabs is the easy part. Creating the tiles is the more time consuming.
-
We have created special displacement maps for s-tiles, and then use Vray displacement on the flat roof slabs. This actually provides pretty decent results in most cases.
-
However, in our experience, you still just can’t beat actual geometry based tiles. The method we use for this is basically a refinement of the great tutorial posted at http://www.robeccaproductions.com/Spanish_Tile_toot.htm . One tile is modeled, then arrayed, then the whole group is attached as a single editable poly. You then position it and use Cut to trim up the roof slab.
This works great, but is still pretty time consuming to align the slabs, and then cut them all, especially on a complex roof, and especially when we build a good 5-10 houses a week.
Here’s the script challenge:
I have been told by an architect acquaintance of mine that someone at their firm created a maxscript that lets them pick the polys that define the roof slab faces and this routine automatically replaces the polys with this complex s-tile editable poly, and trims it up so that it matches the exact edges of the original poly! Pretty slick huh? This obviously saves them a ton of time. Unfortunately, despite my eager requests, they do not at all want to share this incredible tool. Secondly, I really don’t even know where to start on this, as I am a novice scripter at best.
Would someone like to take this on as a challenge? If you figure it out, tons of architectural viz artists would laud you!
If you don’t want to take it on, perhaps someone could at least give me some pointers on some ways to tackle this.
Here are some ideas I have:
-
User selects the editable poly roof object. Each face of the roof is a different poly within this object.
-
Max prompts user to select the s-tile editable poly object. This is a very large object, as wide and as tall as the largest roof face.
-
Max starts a ‘for each’ loop that steps through each poly in the roof.
-
Max obviously know the locations of the vertices on each poly, and uses these to move a copy of the s-tile poly object to align with the poly, lining it up with the bottom edge of the face (the edge having the lowest Z value, obviously), and making sure to rotate it appropriately so the tiles are overlapping properly.
-
Max then uses the vertex locations to calculate where the s-tile poly needs to be cut to match the dimensions of the roof face.
-
Repeat this process for each face in the original roof object.
-
Presto! You just saved a bundle!
Anyone up to the challenge?
I only script as and when I need too so as a result of that I only know a small amount and just pick up the rest as I go along . right now Im working on a script to make a pinao keyboard automatically with just one button press, anyway my point is this , I made all the Keys then exported them as a script . I used the bit of code in the max script help file to do this. I then wrote a script to read that data back into max remaking my Keyboard .so maybe you could do something like that . make your tiles export them as scripts , then write a script to use that data to make a whole roof , I would think it would not be to hard to do, but maybe just take a bit of time to work out , anyway good luck .sorry I cant be anymore help