Using RMB-> apply existing material alot in medium project now and finally atlast got tired of that unsorted list of materials that maya pops up! Its a mess to use after 20+ materials is in the scene. I need it sorted alphabetically to boost workflow and overview. Any ideas how to fix that? Some sorting algorithm inplanted somewhere in mayas core mels? Code snippets to use?
Well yes you could sort them but i dont realy think you get any happier with a sorted list versus unsortred 20 items is just a bit too much data. Thing si when youve got a lot of materials using triple switches suddenly becomes a REALY good option.
Isnt it juts easier to make a window with swatches insetad, that you drag and drop stuff into the scene?
I have written a RMB menu customization whereby you can sort materials via prefixes or by bins. Basically, lets say you have the following materials:
grass_rough1 grass_rough2_dark grass_trimmed grass_default tarmac_smooth tarmac_shiny_reflective sand water wax
if you sort by prefix, your RMB materials menu would contain Two SUB menus, "Grass" and "Tarmac" and the remaining un-prefixed materials, lambert1, sand, water and wax. The grass sub-menu would contain the 4 "grass" materials, and the tarmac sub-menu would contain the 2 "tarmac" materials.
If you switch it to "By Bins" a sub menu is created for every bin you have defined in the hypershade. Each of these submenus will show the materials that are in it, which means you can even show the same materials in multiple sub-menus..
That was pretty simple to do so I guess making it sort alphabetically would be easy too..
Actually, I've just had a look through Maya's RMB material menu code and it would be extremely complicated and tedious to alphabetically sort the materials (you never wondered why it doesn't ALREADY do this?? )
basically, the menu is built up in groups of similar classes of material node. so, for example, you have some blinns, a phong and a load of lamberts, the blinns get listed first (IN ALPHABETICAL ORDER!!) then the lamberts, then the phongs.
The second problem is a integral fatal flaw in alpha sorting algorithmns, and that is the fact that the ASCII values of CAPITAL letters is different (much lower) than that of lower case, so Z will always list before a... this constantly causes me annoyance in Maya... in fact, we should request a case-insensitve flag to be added to the sort command.. now I'd buy that for a dollar..!
Hey, thanks for the useful info! Little late catchup from me but appreciated alot!
That sorting into bins or prefix addition of yours, Naughty, anything you can share? Would help me out alot here handling dozens and dozens (57 atm) of materials.
Jooja - switches is ofcourse fine and useful for handling tons of textures, colors and such but i actually have to use alot of materials/shaders so its not an option.
Basically its a big scene (1 mil tris, 800+ obj) and internal organs and medical stuff so tons of tweaking individual shaders for that nice wetorgan surface or cut flesh look
Anyway, thanks for the quick response, to bad i was slow
Yeah, I can probably make a lot of this stuff public.. though I'll have to re-write a bit of it and extract it from our other in-house tools... I really need to update my web site and add some of this newer stuff.. I'll try and get that sorted this weekend... If I do I'll post something in the MEL forum here so keep your eye open!