Loop over all materials / find material

Hey

What's the best way to get a list of all materials? Assigned/not assigned/scene/non scene/ library etc?

I want to find material by name & assign to geometry.

Regards
Dariusz

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Dariusz's picture

Im sorry... the thing just

Im sorry... the thing just posted it 10x lol sorrryyy....

jahman's picture

.

list all material
as always there's an answer for almost any maxscript related question posted on cgtalk

Dariusz's picture

It works WOHOOO!!!! XXXXX

It works WOHOOO!!!! XXXXX

Dariusz's picture

Ok it partially works, it did

Ok it partially works, it did not list any materials from loaded libraries :c
Any idea how to fetch them?

jahman's picture

.

check mxs reference for loadTempMaterialLibrary
I guess you'll have to iterate over library materials to join them to the list

Not sure how can you get all the loaded libraries in SME, but I found that they're listed here:
C:\Users\User\AppData\Local\Autodesk\3dsmax\2014 - 64bit\ENU\en-US\defaults\MAX\MtlBrowser.mpl
it is a simple xml config file
unfortunately it doesn't update right after user loads another library, so you'll have to find a workaround

hope it helps

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.