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.
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
Solved! Go to Solution.
Solved by darawork. Go to Solution.
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
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).
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.
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
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
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