Community
3ds Max Forum
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Merging material libraries (.mat)

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
darawork
5969 Views, 5 Replies

Merging material libraries (.mat)

Hi,

 

Just wondering if it is possible to merge .mat libraries together?

 

I'm in the process of merging all the IDST libraries together into categories.

When I get it all done I'll upload them in one location for all to download.

 

Thanks to IDST for all the free libraries, good site btw... well worth a visit.

 

http://www.idst-render.com/

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

5 REPLIES 5
Message 2 of 6
darawork
in reply to: darawork

Found a script to do it:


(
    rollout mergeLibs ".mat merger"
    (
        local matArray = #()
        local matsCollected = 0
 
        button btn_getFiles "Add Files" width:200 height:25
        label lbl_foundMats "Materials Collected: 0"
        button btn_setDest "Choose destination" width:200 height:25 --enabled:false
 
        ON btn_getFiles PRESSED DO
        (
            local theDialog = dotNetObject  "System.Windows.Forms.OpenFileDialog"
            theDialog.Multiselect = true --allow multiple files to be selected
            theDialog.title = "Add Files"
            theDialog.Filter = "Material Library (*.mat)|*.mat|All Files (*.*)|*.*" --specify the filter
            theDialog.FilterIndex = 1
            local result = theDialog.showDialog() --display the dialog, get result into variable
            result.ToString() --when closed, convert the result to string
            IF (result.Equals result.Cancel) != true DO --returns TRUE if Cancel was pressed, FALSE otherwise
            (
                FOR theFile in theDialog.fileNames DO
                (
                    local theLib = loadTempMaterialLibrary theFile
                    IF theLib != undefined DO
                    (
                        FOR theMat in theLib DO
                        (
                            append matArray theMat
                            matsCollected = matsCollected+1
                            lbl_foundMats.text = ("Materials Collected: "+matsCollected as string)
                        )
                    )
                )
            )
            IF matArray.count != 0 DO btn_setDest.enabled = true
        )
        ON btn_setDest PRESSED DO
        (
            local matSavePath = (getSaveFileName caption:"Save Material Library" types:"Material Library (*.mat)|*.mat")
            IF matSavePath != undefined DO
            (
                local matLibrary = materialLibrary()
                FOR theMat in matArray DO append matLibrary theMat
                saveTempMaterialLibrary matLibrary matSavePath
            )
        )
    )
    createDialog mergeLibs width:220
)

 

I tried to use the insert [code] forum functionaity but it didn't work for my browser.

 

Script thanks to http://www.scriptspot.com/users/marco-brunetta

 

 

The weird thing is that it looks like Max used to have this functionality:

http://www.3dmax-tutorials.com/Merge_Material_Library_Dialog.html

 

But I can't find it anywhere.

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 3 of 6
Steve_Curley
in reply to: darawork

Merge is still there, but you need to use the old Material/Map Browser. Find SME.ini (ENU\plugcfg_ln\sme.ini), open it in Notepad, locate the [Material Browser Section] and change the UseOldMtlBrowser=0 line to UseOldMtlBrowser=1
You will still see the new one inside Slate itself, but if you go to Rendering > Material/Map Browser you'll get the old one. Browse From Material library and you'll see the Merge button appear (below Open).

OldMatBrowser_Merge.png

If you get that problem again (not being able to insert code properly), edit the post (immediately - there's a timeout), carefully delete the code, switch to entering by html (as opposed to rich text) and re-paste the code then edit in < PRE > and < /PRE > tags (without the spaces) around it.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 4 of 6
darawork
in reply to: Steve_Curley

Thanks Steve

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 5 of 6
darawork
in reply to: darawork

http://www.sendspace.com/file/p8vska

 

IDST Mental Ray Materials zip file (218.95mb)

Darawork
AutoDesk User
Windows 10/11, 3DS Max 2022/24, Revit 2022, AutoCad 2024, Dell Precision 5810/20, ASUS DIY, nVidia Quadro P5000/RTX 5000/GTX760

Message 6 of 6
paulobelesa
in reply to: darawork

HI   ! 

 

Is it possible to do the same with various .max files instead of .mat? 
I work with 3d for more than 8 years so I have tons of materials from jobs. 
It would be wonderfull if i could merge them all 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report