This is a question one of my colleagues asked a while ago on CG Society and never got an answer, so I thought I'd try asking here. He has since left the company and I have inherited this project:
I'm working on a project that involves taking a large amount of textures (500+) and generating a set of material libraries from them. Due to the large amount of textures, I'm looking for ways to automatically categorize and group materials, making the library easier to navigate.
Right now I've categorized the materials by type, where each type gets its own materials library file. Here’s a small snippet of the files I've generated, each with anywhere from 1-50 materials specified within it.
My goal is to write a script that will take a folder full of material library files and automatically load them up in 3ds Max, resulting in something like this:
In trying to get here, I’ve run into a couple of problems:
- I can’t find any documentation specifying how to access and modify the Material/Map Browser via maxscript. I would like group all the libraries so it looks like the image above, but I can’t find any documentation on how to do it. Every time I do a search on grouping material libraries together, I just get documentation on grouping geometry.
- When I load a material library using the “loadMaterialLibrary” method, the library comes in labelled as a “Temporary Library”, ignoring the filename:
...but when I load it in manually using the file menu, it comes in with a proper name (i.e. Metal, Fabric, etc.)
How can I load in a material library via script and keep the filename describing it?
Thank you.