View Full Version : File Browser within mxs rollout?

01 January 2009, 03:53 PM
is it possible to display a file browser window within a maxscript rollout? The file browser should be navigable and a file should be selectable (and the selection should then be given to the mxs rollout).

On opening the rollout with the browser window I would like to display a specific location in the browser and be able to change that location based on events within the rollout.

Is that possible, maybe with .net? Could someone point me to where to look for this?


01 January 2009, 06:35 PM
Can you post some code of what you are doing?

01 January 2009, 09:57 PM
Well, there is not much code yet to show and I don't have access to Max right now. It is basically a simple rollout with some checkboxes and dropdown lists and I want to add a window which shows a file browser like the windows explorer. Based on the selection the user makes with the option boxes in the rollout, the file browser should jump to that position within the file tree. The position where we are in the file explorer should update if the user changes any of the option boxes in the rollout. Furthermore the user should be able to select a file in the explorer.

The general idea is to guide and to automate the opening of a max file.

Any ideas?

01 January 2009, 11:44 PM
'fraid that the standard .NET doesn't have a one-does-it-all 'windows explorer'-type control.. you've basically got two options..

A. Grab a (third party) assembly that offers such a control, or components for such a control - Microsoft themselves offer two components that would help in building such a control the Visual Basic .NET Power Pack:

B. Build your own using a treeview and a listview - ouch.

Based on what you seem to need - you might be able to use just a treeview.. sounds like the user would have limited options (user presses a button and the treeview selection changes to the correct branch) and interaction needs (user selects a leaf (file) from the treeview branch). That's nowhere near a full 'windows explorer'-type thing, but if that's all you'd need...

01 January 2009, 09:25 AM
The Power Pack looks pretty promising. But I have no clue on how I would use the package with MXS. Is that complicated?

01 January 2009, 10:44 AM
Even more basic would be having a listbox with functions to display stuff from the folders:) Really hacky, might not be the best way visually, but it is pretty fast, faster then the windows explorer, and you can control what you want to display and even have previews of what is in each folder (i.e. Looking for Max files).

01 January 2009, 01:02 PM
The Power Pack looks pretty promising. But I have no clue on how I would use the package with MXS. Is that complicated?
eh.. it looked promising-ish to me as well, but just finding a download for the thing is a mess.

This should have had the link:
And it does, but it points to:

And GotDotNet? is of course deader-than-dead-dead.. and if you think Microsoft at least relocated all that knowledge and data somewhere else...
Unforunately when GotDotNet got phased out the VB Power Packs project did not get moved to CodePlex.

Anyway - that quote is from the following thread, where a helpful fellow did post a URL for an alternate location to get the pack:
But keep in mind that this is a third party offering the package, etc. etc.


Back on-topic... if/when you do download a library of .NET controls and such, using it is pretty simply.. first you load the library:

dna = dotNet.loadAssembly "c:\\3dsmax11\\VbPowerPack.dll"

And then you're basically done. Check the documentation for how to use the thing.. I haven't, so all I'm getting is the icons of my machine's 'root' displayed with this:

rollout test "test" width:800 height:600 (
dotnetcontrol dnc_fileviewer "VbPowerPack.FileViewer" width:750 height:550
createDialog test

That "VbPowerPack.FileViewer" should be in the documentation, I just leeched it from poking about at the results of:

print (dna.GetExportedTypes())

Again, though, see if using a fancy control may actually be overkill for what you need.

01 January 2009, 01:53 PM
looks like a few useful nibbles in there Rich, I'll have to take a look at that.

not tried any, but codeproject also has a few .net directory browsers that could be used in the same way mentioned previously.

01 January 2009, 08:23 AM
Thanks Richard for explaining how to use a .net library and for finding that link to the package...

As the task description for my script got one more time changed and the file browsing option for the rollout got more simplified I think I will stick to a .net treeview or a mxs listview. Even though those file browsers from all the different libraries that were mentioned look much cooler...;-)

Once again, thanks a lot for your insights!

CGTalk Moderation
01 January 2009, 08:23 AM
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.