Advice Needed for Asset Management Script


I am embarking on my first maxscripting project (besides a few smaller ones that I have done) and wanted to post here for some process oriented suggestions for how I can make this script happen, first by thinking it through, then implementing it. Let me preface this by saying that I am an “artist” not a programmer, but relatively inquisitive enough to figure things out as I go along.

What I would like to do, is to create an asset management script – this script would be a flyout dialogue box with small thumbnail images that would be linked to a mesh file or vrayproxy file (i.e. a tree or a car). I want to be able to click on the thumbnail and click into the scene to merge/insert the object into the scene.

This would be Phase I of the script.

Phase II would include categorizing assets into relative subsets, i.e., Trees-Tropical, Trees-Deciduous, etc. and then adding a radio button to select either the RawGeometry file, or the VrayProxy.

My idea came while watching a tutorial for another script called RenderMask. I’ve contacted the author of the script to how he had done his, but unfortunately, he isn’t willing to share the information for the particular asset management script at this time.

For a better understanding of what I would like to do, watch the following video – Time code 1:54-2:04 specifically. This is the script I would like to duplicate.

click on the link

Because it is my first script, I’d really appreciate the following:

  1. Any prior knowledge of a similar script (so I can dissect it!)
  2. Any advice on how to plan out the sequence I would need to make this script work
  3. Any advice on specific commands/actions needed to complete the script.

Thanks in advance for your help as I delve into the world of scripting.

Also – Please note that I am a lone artist with my own little assets. At this time I am not developing this to be some big behemoth of a script that would be on a server, dynamically updated, etc. Its just a little pet project to learn more scripting and to manage the 50 things that I use all the time.



There is probably a million things you will want to study up (these are MaxScript Help topics):
[li]File Name Parsning[/li][li]BMP Interfaces[/li][li]3ds Max File Loading and Saving[/li][list]
[/list]You will also probably want to look at setting up sort of “preview” rendering mechanism, something that can scan a bunch of files and produce your thumbnails for you automatically, or a means by which you can add new files (ie, select a file, generate preview and then have those files added to your repository…)

Depending on your version of max, a good understanding of the UI will also be required. If possible, I’d suggest DotNet…

Personally, I’d also have a long hard look at XML, it would make a much better format for meta data and would be quicker to parse then scanning through a bunch of folders…but thats just me.



I am looking for exactly the same thing! this script seems to be everything our asset collection needs. so if anybody could produce anything like this please keep us all in the loop!


I’d also be considering if maxscript is the best solution. Personally I’d be leaning towards a 3rd party element (java or python using a COM bridge) as they are more robust have a deeper API for handling this type of jobs.

At the very least, a plugin…


Hi, RustyKnight.

thank you for your advice.

I love vrayproxy, need vrayproxy library manager plugin… so , if you have time, could you try it …thank you…


I think you misunderstand what I am saying…

I’d use java or python to manage the file handling process and maybe the UI.

You can only pass primitive types over a com bridge…string would be my personal preference…



Also don’t count out a full fledged relational database as the back end.

I’m converting our big toolset right now to use MySQL. The entire scene can be reconstructed from the database and it’ll let you use all the existing relational data tools instead of coding them yourself.

If you’re going to go through all the trouble of creating an asset management system it might as well run outside of Max. I would try to do as much in a portable language as possible.

That all being said… what’s in that frame is quite simple. I would define a struct “Categorystruct (CategoryID, Name)”

Create an array of categories.

Createastruct called ItemStruct (ItemID, CategoryID, Name, Filepath, ThumbnailPath)

Create an array of items.

Populate the category drop down from the category strut.
dropdown.items = for o in categories collect

CategoryItemArray = for o in itemstruct where o.categoryid == dropdown.selection collect o

rolloutstring = “” as stringstream

format “rolloutdef = ALL THE ROLLOUT DEFINITION STUFF” to: rolloutstring

then something like

for o in CategoryItemArray do
format “%Button% blah blah blah bitmap:openbitmap % etc etc” o.itemid o.thumbnailpath to:rolloutstring

then something like

for o in CategoryItemArray do
format “on %button% pressed do mergemaxfile %” o.itemid o.filepath to:rolloutstring

format “END ROLLOUTSTUFF” to:rolloutstring

removesubrollout (existing subrollout)
execute rolloutstring
addsubrollout rollout rolloutdeffromstring


so nobody knows of any commercial plugin or script that does this?


Commercial eh? How much you willing to pay. :smiley: I’ll make a commercial script.


Hi thatoneguy.

You want to make a commercial script?? did you know the vrayscatter made by icube. this will be sale 100 euro. If you can make out this , how much do you think It’s fine to sale.


I don’t know what VRay Scatter does. I presume it’s more sophisticated than this. But this’ll merge in a file from a small asset library. Note you’ll need to create your own scene library following the included examples. Also note this will crash if you don’t have a C: est\etc



Ok. I added a button which parses a directory full of directories… which is full of scenes and thumbnails (100x100 pixels)

Or you can hard code in your libraries as before:

-- Basic Asset Manager by Gavin Greenwalt  --
---- Straightface Studios :| Seattle, WA ----
---------- version 2.0 kind of --------------
Global AssetManager, ScenesDialog
Struct AssetManagerStruct (Categories=#(), Scenes=#())
Struct SceneStruct (ID, CategoryID, Name,Path,Thumbnail)
Struct CategoryStruct (ID,Name)
try(destroydialog AssetManagerDialog)catch()
AssetManager = AssetManagerStruct()
AssetManager.Categories = #(
--- Template Categories ---
-- CategoryStruct ID:1 Name:"Category One",
-- CategoryStruct ID:2 Name:"Category Two"
--- End Template Categories -- 
AssetManager.Scenes = #(
--- Template Scenes ---
-- SceneStruct ID:1 CategoryID:1 Name:"Box One" path:"C:\	est\\Box_01.max" Thumbnail:"C:\	est\\Box_01.jpg",
-- SceneStruct ID:2 CategoryID:2 Name:"Box One" path:"C:\	est\\Box_01.max" Thumbnail:"C:\	est\\Box_01.jpg"
--- End Template Scenes -- 
Rollout AssetManagerDialog "Manage Your Assets" width:450 height:400
 fn QuadifyString stringvar =
  stringvar = filterstring stringvar "\\"
  assembly = ""
  for i =1 to stringvar.count - 1 do
   append assembly (stringvar[i]+"[\\\\\\\\](")
  append assembly stringvar[stringvar.count]
 DropDownList CategoryDropDown "Categories:" across:2
 Button CustomLibraryButton "Load New Library From Path" height:40 offset:[0,5]
 subrollout ScenesSubrollout "Scenes" width:440 height:335
 on AssetManagerDialog open do
  CategoryDropDown.items = #("")
  CategoryDropDown.items = (join CategoryDropDown.items (for o in AssetManager.Categories collect
 on CustomLibraryButton pressed do
  thumbnailtypes = #(".jpg",".tif",".png",".bmp")
  newpath  = getsavepath()
  newcats = getdirectories (newpath+"\\*")
  AssetManager.Categories = #()
  AssetManager.Scenes = #()
  for i = 1 to newcats.count do
   catname = (filterstring newcats[i] "\\")
   catname = catname[catname.count]
   append AssetManager.Categories (CategoryStruct ID:i Name:catName)
   scenes = getfiles (newcats[i]+"*")
   maxfiles = (for o in scenes where (getfilenametype o == ".max") collect o)
   thumbnails = (for o in scenes where (finditem thumbnailtypes (getfilenametype o)) != 0 collect o)
   for o in maxfiles do
	idval = (AssetManager.Scenes.count + 1)
	scenename = getfilenamefile o
	thumb = (for t in thumbnails where (matchpattern (getfilenamefile t) pattern:(getfilenamefile o)) collect t)[1]
	append AssetManager.Scenes (SceneStruct ID:idval CategoryID:i Name:scenename path:o Thumbnail:thumb)
  CategoryDropDown.items = #("")
  CategoryDropDown.items = (join CategoryDropDown.items (for o in AssetManager.Categories collect
  try(removeSubRollout AssetManagerDialog.ScenesSubRollout ScenesDialog)catch()
 on CategoryDropDown selected s do
   s -= 1
  try(removeSubRollout AssetManagerDialog.ScenesSubRollout ScenesDialog)catch()
  ScenesString = "" as stringstream 
  format "Rollout ScenesDialog \"Assets\" (
" to:ScenesString
  scenes = for o in AssetManager.Scenes where o.CategoryID == s collect o
  if (scenes).count != 0 then
   for o in scenes do
	format "Button Button% \"%\" images:#(\"%\", undefined, 1, 1, 1, 1, 1) width:100 height:100 align:#left across:4
" (QuadifyString o.thumbnail) to:ScenesString
   for o in scenes do
	format "on button% pressed do
" to:ScenesString
	format "(
" to: ScenesString
	format "mergemaxfile \"%\" #Select 
" (QuadifyString o.path) to: ScenesString
	format ")
" to: ScenesString
   format "label NoMapsLabel \"No Scenes Found\"" to:ScenesString
  format ")" to:ScenesString
  execute (ScenesString as string)
  AddSubRollout AssetManagerDialog.ScenesSubRollout ScenesDialog

createdialog AssetManagerDialog


well done, thatoneguy~!!
that’s great, I think you can do it whole.



Just to be clear here is the directory structure it expects:

…\LibraryPath<Category Names>\filename.jpg&.max

just did a cursory glance abouts the internets and found no documentation for creating a Vray proxy. So if someone would be so kind as to find that I would tack it on.


I’ve been thinking about this for the exact same purpose. I thought a simple solution could be to use html (i.e. use a web page creation program) to create the directory tree with thumbnails etc and use i-drop links to drag and drop the max scenes (e.g. containing only a pre-textured vray proxy) into your current scene.

I’ll check out your script, thanks.


Our Cat browser uses a dynamically generated html page, via an activeX controller, to display the contents. This allows drop and drop as well as controls to add to a list of items to merge.

A tree view shows all available directories, minus ones that begin with “Z-”.

A simple partial string function, for “seaching”, sorts on the filenames during the generation of the html page.

Wish I could share it, but it’s not mine…


that loosk quite useful Kieth, if i may ask how are you generating the html? this is one of the couple projects that i’m looking at making in whatever spare time i can dig up also :wink: especially since the default max asset browser looks to be completely non-functional at the moment


The webpage was initially designed in dreamwaver then I copied the html in the script line by line as strings to use as a template. There is also a function that looks in the directories and based on the files existing there and with the help of the html template builds the webpage and saves it in a temp folder from where it gets read by the activex. So everytime you change the directory that page is rebuilt.

Some extra functionality that the script has is to enlarge the thumbnail to a full size render, you can open the curent folder in windows explorer and you can add items to a merge queue and import them all at once.

I hope it made sense, it’s been a while since I wrote that and as Keith was saying I wish I could share it but it was done while at Focus so they have all the rights for it…


i agree Gavin Greenwalt. any works should be pay in suitable .

im a max script developer for 3 years , used to work in Crystal CG shanghai for about 2 year .

in china , most animate studio using 3dsmax , and do not have a TD .

for this work , i can work it out in a month . but as for TD , i expect to serve a studio for long time , not just do one script tool when somebody needed . for simple script we can do for free , and for this one , we cant .


i suggest u hire a TD like Gavin Greenwalt , it will be a great help for ur work pipline . a good TD can be freelance guy .