Advice Needed for Asset Management Script


Think I’m going to have to write my own one of these for our company, we could really do with one for browsing HDRs and models.


Hey Anton;
How’z out there in the freelance world?

Perhaps talk to Anton about him writing one of these for you, it’s a great tool and I’m sure he could make it even better the second time around, plus customize it to your file structures and workflow. He was here at focus360 for years and writes some nice code…


Hey Keith, freelance world is pretty good, cannot complain. As from the writing nice code all I can say is that I’ve learned from the master :bowdown:. Any plans for siggraph?

You are right, hiring a TD to help streamline the pipeline is one of the best moves a company can make if cannot afford to have one in house full time which is the proper thing to do!


Thanks for the shot of what you have, and the tip on the dynamic web page, seems to be a pretty valid way to do it.

If i may ask, how are you sending info on which thumbnail or button was clicked back to the maxscript from the web control?


Well, so far I’ve got my auto generation of the basic page (Fills an array of thumbnails into a table) based pretty heavily off of Gavin’s code above, I’ll post something about it when its a bit more stable after I get a few more minutes to toy with it.

I’ve also done a bit towards generating the thumbnails from our initial directory of props, using PEN’s BatchItMaxcombined with a couple scripts Description: here namely the Render Thumbnail script

now to figure out the rest of the UI :slight_smile: am I demented for enjoying figuring this junk out?


The activex control has an event called “NavigateComplete2” and I’m using it to send the path back to maxscript. To find all the events just querry your activex using “showevents”


Thanks for the reply Anton… I’ve got it running so far :wink:

As with most questions i find myself asking, i find myself finding the answers something like .27ms after posting the questions.

anyway! now the fun part is working up an easy way to throw a directory tree into a treeview. which is more or less working on the fly using a fun little struct here: albeit very slow for large directory structures. So… now figuring out the fun of saving that out to disk and only reloading the directory tree as needed. :slight_smile:

thats probably the last of the code for a while though as projects are ramping up again :wink:

Struct DirTreeItem (dir, depth, name, treenode)
Struct DirTree (
	pathToParse = "",
	fn parseDirectories root depth =
		local dir_array =#()
		dir_array = GetDirectories (root+"/*")
		for d in dir_array do
			local splitName = filterstring d "\\"
			local dirName = splitName[(splitName.count)]
			append Tree (DirTreeItem dir:d depth:(depth+1) name:dirName)
			--try and add it to the child node if we have one, else add it to the parent
			try(parseDirectories d (depth+1)) catch(parseDirectories root depth)
	), -- End fn

	fn selectPathToParse = 
		pathToParse = (getSavePath caption:"Select which Directory to Parse into a Tree" initialDir:"C:/")
	fn Run =
		if pathToParse != "" then
			st = timestamp()
			append Tree (DirTreeItem dir:pathToParse depth:0)
			parseDirectories pathToParse 0
			format "Directories.parseDirectories() completed in [% ms]
" (timestamp()-st)
		) else messagebox "set the DirTree.pathToParse before calling DirTree.Run()
 or Call DirTree.selectPathToParse() first to select it from a list"
DT.pathToParse = "Z:/Prop Catalog"
-- DT.selectPathToParse()


You are right, recursively going through all the directories and loading the tree everytime takes a bit but for us where there were a few artists that would change the library it was the right way. Waiting 5 seconds was better than not having the correct tree showing. Anyway, I think that if the recursive function would be written in Python or VB outside of max would be much faster.


Hmm, I’m not finding offhand how to do it with a ‘System.Windows.Forms.WebBrowser’

So far i can’t seem to get the mouseup or mousdown or click functions to actually get called at all.

my original thought was to find the location of the click, find which image as under the mouse, and look up the item from there. but I’m having trouble getting any of the mouse based functions to trigger so far.

Has anyone else dealt with this yet?


To answer:

you have your buttons or images or links or what have you in your Html file append a ?information to the webbrowser.url and retreive it in the:

on webbrowser navigated page do by way of the page.url.tostring()


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.