[Closed] Loading .max file as Material library
Is there a way to load the material library of a max file. By going through the material editor and clicking load materials then changing the file type to .max and then choosing a max file it then loads the materials from that max file into the material editor library.
How is this possible through maxscript?
Yes you can (tested in 2012 and 2011 not sure about previous releases), but you can use:
pathToMaxFile = C:\file.max
with quiet on (loadmateriallibrary pathToMaxFile)
You need to use the with quiet on as it will throw an error, but the material is loaded into the CurrentMaterialLibrary global variable. However, it is listed in the Slate editor in the Temporary Library.
-Eric
This is great news. Awesome Find Eric.
Thank you for not only posting the solution but explaining why it is done this way.
It helps a ton.
Thanks again.
JokerMartini
Well if you didn’t have Slate open or checked the CurrentMaterialLibrary you never would have know it worked (except for the returned true to the listener), because of the error popup window.
-Eric
Interesting, can say that in Max 2009 that not work
but good to know its improved into recent Max versions.