technical architecture.

Adventures in maxscript.. (Or, asset management part 2.)

by on Aug.26, 2008, under maxscript

A couple days later, and a few hours of learning in, and i’ve built up the starting point for what i think is a somewhat useful asset/library management system.

The Basics as they stand so far:

  • Choose a root directory that you have your meshes stored at.
  • for each directory in the root tree, add an entry to the treeview on the left, a’la explorer.
  • when you click on any leaflet of the treeview, we build on the fly an html thumbnail page of the Maxfiles/Thumbnails in the directory with a few basic informational items.
  • clicking on a thumbnail, imports a model.

That glosses over some of the fun parts of getting the thumbnails of each model, and general organizational bits involved in maintaining your asset library, but thats it, clean and simple.

Its what i imagine that Utilities menu ‘Asset Library’ would do, if it didn’t just make max fast exit.

Progress!

Now to evaluate the work involved in making it bulletproof enough to possibly be useful outside of our small studio.

  • Features on the horizon:
  • fully cached directories (Done!, only recurse the filesystem once.)
  • Multiple Library Classes:
    • Mesh
    • Material
    • Texture
    • Texture as Billboard
  • Queue of meshes to load
  • Placement of meshes on load? OR integrate the idrop functionality
  • include maxfiles that do not have thumbnails (extracting the explorer thumbnail preview)

Well, that’s probably enough to kill off my free time for a few more days.. Heh!


6 Comments for this entry

  • leklek

    good..ddddddddd..thank

  • Dan Hernandez

    Hi I was wondering what max version are you creating this script. Are you using ActiveX Control or Dotnet Method to create the Directory Tree on the left hand side of your interface? I absolutely love this script and have been trying to create something like this for sometime now. Would love to see your source code for this script. I def need a lot of help. haha Especially being a newb to maxscripting.

  • Dan Hernandez

    Hey I’ve actually been wanting to do this script for sometime now. I’m pretty new to scripting so I just had a question for you. I was wondering how are you able to access the explorer directory on the left hand treeview? Do you reference a .ini file or do you just create nodes within maxscript like rootNode.text = “Z://Model_Library//”?

  • Dave Buchhofer

    I actually abandoned this one in favor of the python version since the tree was so slow to update, i believe i just had the root node hard coded in the script, and used a basic recursive search for directories, filtering out the ‘textures’ dies in the process. I ended up making it cache the directory tree to an ini file after it discovered it, because initial load times were so slow, so it works fine as is, you just need to occasionally refresh the tree manually if you continue to expand the library… Not exactly optimal!

    Later on i found it easier to use a ‘lazy’ style loading for the directories, where it would just search 2 layers deep in the tree At any one point, and would then load further down as needed in the process of expanding that layer of the tree view.

    I have the code for all this stuff still, sitting more or less idle, it should be vaguely readable if you’re interested.. It was one of my first larger solo scripting projects, so there’s bound be a lot of “why would he do that” moments in there though.

  • Dan Hernandez

    Haha love the “why would he do that line”! Made me chuckle. I would love to see the code for mere educational purposes if it was cool with you. Self teaching is somewhat daunting when you need something specific to do and you can’t find any examples out there. I did see however that max has a Asset Browser which does some of these features and yes I also saw the python script as well but not sure if it runs on Max 8 or not. Oh well let me know if you can post the script. Thanks Dave!

  • dave buchhofer

    Here is the script package for the above, i’m afraid its pretty fragile in that i was mostly experimenting and learning at the time, so there are a few includes across the script that you will have to edit if you want to use it at all.

    http://www.buchhofer.com/upload/files/Scripts/PropCatalogScript_ALPHA.zip

    I abandoned this in 2008 or so in favor of a python based solution that was a TON faster.

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!