Hi there,
I'm just wondering how to fill a certain area with existing polygons in Maya?
The main goal is to get like about 10 books and scattering them across different shelves.
Most solutions provided in Maya are not adequate and doing this manually is a pain. I'm a little lost on the MEL part. Does anyone know of a basic example or solution I can work with to get started?
Replies
would be pretty simple to do this vai python.
i could make a script that lets you scatter objects within the volume or ontop of a other object which could be your shelf.
or if you want to work with existing scripts that are already out there, you could use the 'duplicate along path toolbox' script, which lets you scatter things across a curve, which you could make buy selecting a edge loop in your book shelf and running the 'CreateCurveFromPoly' command
Duplicate along path is fantastic for fences etc, but ultimately I'm not sure it would be the best solution for this type of job. Unfortunately there are a lot of shelves to be filled and I think instead of manually doing it like I always do (I usually have to do this a lot on projects) I'm hoping to learn how automate a few things for short term pain, long term gain!
http://www.scriptspot.com/3ds-max/scripts/fill-my-bookshelves
This is the basic idea.
I'm not aiming for something that complex at the moment. Just something basic as I have no idea on the initial code or any ideas on how to actually "fill the volume or on top of another object which could be your shelf." like you mention. I tried a few things, but can't come up with anything so far.
best way would be to grab the bounding box information from the selected polygons, and work with that data. you would also want to but some tests in compare the bounding boxes of the books to so they don't intersect.
Thats just the basics you could also add in random depth values too in a range of the shelfs depth or a manual range, and with a little more math, have some books flat on there side or leaned where there is space for them.
Thinking i will make this at some point to toss on my portfolio site once done, but thought i should explain the basics since i don't use mel.