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

Join the discussion and tell us your opinion.

  • 2009-11-20 at 01:47

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

  • 2009-11-22 at 18:57

    Thanks Agreb.

  • 2009-11-24 at 13:43

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

    • 2009-11-24 at 23:58
      In reply to: agreb khalid

      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

  • 2013-04-24 at 04:34

    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

  • 2013-04-25 at 17:35

    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

    • 2013-04-25 at 22:08
      In reply to: fajar

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

  • 2013-04-26 at 05:12

    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.

    • 2013-04-28 at 20:51
      In reply to: fajar

      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

  • 2013-04-29 at 15:34

    Okey…will senyt it soon.

    Thanks

  • 2013-04-29 at 16:01

    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

This site uses Akismet to reduce spam. Learn how your comment data is processed.