Materilarium script

After a while of developing, here’s the first version of Materilarium. It’s a material database-type script for 3ds max. This script is by no means error-free, fool-proof or guaranteed-to-be-stable. It’s very useful though.

The general idea is that the user can import a 3dsMax matlib, render thumbnails for every material, create groups and assign the materials to the groups. Most of this isn’t very new, but the script works with drag&drop and a single material can be assigned to multiple groups.

Install

To install the script: drop the .mzp-file onto a viewport in max. It will copy itself to the $userscripts folder. The script comes with the default 3dsMax matlib (version 2008). I’ve pre-rendered it and also done some demo categorisations.
The script uses an xml-file to store the references to the matlibs and images.

This is the main interface

 

The general workflow

 


13 comments

agreb khalid

your script is very useful i wanted to tel you that i love it thinks

Klaas

Thanks Agreb.

agreb khalid

can it wark in max 9 ? iv tested it and it dont im using max 9 with no SP.

Klaas

Hi Agreb,
the script has been developed on max 2008. I’m afraid it will take me a lot of work to port it to max 9. You might have some luck after installing the avguard extension for maxscript. It has been integrated in max 2008, but has to be installed separately for max 9.
Klaas

fajar

Mr. Klaas could you fix it in order to get to work on max 2014.

Btw Mr. klass I have a question about dotNet maxscript, which is faster , generating thumb ui using flowlayout panel and dotnet image list ?

Thanks

Best regard

fajar

Hi Fajar,

I haven’t used this script in ages. I’ll probably won’t work in it in the near future, I’m sorry.
About the thumbnails: I have good experiences with a dotnet thumbnail-control by Jason labbe: http://www.jasonlabbe3d.com/pages/thumbnailViewerControl.html. You can also try hitchhiker by lonerobot: http://lonerobot.net/?p=1003. Loading thumbnails myself in a flowlayout or imagelist never resulted in something quick and memory-efficient.
Klaas

fajar

Thanks for you ansower, Mr.Klass. i already try Mr.lone robot controler. but it only support few image file and it wont work the way I want it ( not suit with my work flow tho). Btw for thumb generation ,which dll do you using now Mr.Klass?

Thanks

Best regard

Fajar

I think in this script I’ve done it myself but I’ve used the one from Jason Labbe as well.

fajar

OK got it Mr. Klaas Nienhuis, im trying to build my own asset manager. Could you give me an example how to drag drop file from asset manager [using “System.Windows.Forms.ListView” , so I can drop file , like max file to viewport, I can have merge rC like., like your materilarium.

I try using this , from lone robot…


on dNet_Files mouseUp sender arg do
(
if (sender.clientrectangle.contains arg.x arg.y) then ( )
else
(
filenameString = "D:Detail Furniture.max" --maxfilearray[1]

dropfile = dotnetobject "System.String[]" 1
dropfile.setvalue filenameString 0
DataObj = dotnetobject "DataObject" ((dotnetclass "DataFormats").filedrop) dropfile
sender.dodragdrop Dataobj ((dotnetclass "DragDropEffects").Copy)
)
)

but it didnt work like on lone robot do. what is my mistake .

Thanks for enlighten.

Hi Fajar,

it’s difficult to judge what’s going on without seeing the entire script. The handler you’ve posted here differs from the one from lonerobot. He describes that the object you pass to the dataobject has to be very specific and can’t be just some string, like you assign to the “filenamestring” variable. I suggest you try to match your example as close as you can to the one from lonerobot.

Klaas

fajar

Okey…will senyt it soon.

Thanks

fajar

Here is the sample script !


try(destroyDialog theRollout)catch()

fn populateList thLv=
(
thLv.items.clear()
myMaxFile=getFiles "H:Try*.max" --the max file folder
for i in myMaxFile do
(
item = thLv.items.add i
item.tag = dotnetmxsvalue i
)
)

fn initLv theLv=
(
AlignTo=dotNetClass "System.Windows.Forms.HorizontalAlignment"
theLv.view=(dotNetClass "system.windows.forms.view").details
theLv.FullRowSelect=true
theLv.GridLines=true
theLv.MultiSelect=false
theLv.gridlines = true

theLv.Columns.add "myMax File" 295 AlignTo.center
)

rollout theRollout "The Rollout" width:300 height:300
(
dotNetControl lv "system.windows.forms.listView" pos:[0,0] width:300 height:300

on theRollout open do
(
initLv lv
populateList lv
)

on lv mouseUp sender arg do
(
if (sender.clientrectangle.contains args.x args.y) then ( )
else
(
theArg=theRollout.lv.SelectedItems.Item[0].tag.value

dropfile = dotnetobject "System.String[]" 1
dropfile.setvalue theArg 0
DataObj = dotnetobject "DataObject" ((dotnetclass "DataFormats").filedrop) dropfile
sender.dodragdrop Dataobj ((dotnetclass "DragDropEffects").Copy)
)
)

)
createdialog theRollout

Before , im sorry Mr.Klass for your time

Thanks in advance

Leave a Reply

* Will not be published