View Full Version : mtlBrowser.browseFrom, how does it work?
Bercon 01-01-2007, 05:51 PM Quote from maxscript reference:
"mtlBrowser.browseFrom [#mtlLibrary | #mtlEditor | #activeSlot | #selected | #scene | #new]
Lets you set the Browse From: source for the modeless material browser."
When I try to use this function all it does is return "OK". How am I supposed to open this modeless material browser?
|
|
Quote from maxscript reference:
"mtlBrowser.browseFrom [#mtlLibrary | #mtlEditor | #activeSlot | #selected | #scene | #new]
Lets you set the Browse From: source for the modeless material browser."
When I try to use this function all it does is return "OK". How am I supposed to open this modeless material browser?
In this instance, the Help is a real mess (it was this way before my time though ;o)
See "Miscellaneous Dialogs" topic for the answer:
materialBrowseDlg [#mats] [#maps] [#incNone] [#instanceOnly]
This method puts up the Material/Map Browser. This method returns undefined if no Material or TextureMap is picked, otherwise a copy or instance of the Material or TextureMap is returned. The definition of the parameters are:
#mats
Display Materials only.
#maps
Display TextureMaps only.
#incNone
Include "None" as a Material and TextureMap.
#instanceOnly
If the selected Material or TextureMap already exists, the returned value contains an instance. Otherwise a dialog is displayed for the user to specify Copy or Instance.
If neither #mats or #maps is specified, both Materials and TextureMaps are displayed. If both are specified, TextureMaps are displayed.
mtlBrowser.browseFrom [#mtlLibrary | #mtlEditor | #activeSlot | #selected | #scene | #new]
Lets you set the Browse From: source for the modeless material browser.
For example:
mtlBrowser.browseFrom #mtlLibrary --set the browser to mtlLibrary
materialBrowseDlg #mats --show mats from the library
Oh, and it is not even modeless, it is modal.
Somebody should fix the docs... ;)
Bercon
01-01-2007, 08:27 PM
Ah, thanks! Works like a charm.
Bercon
01-02-2007, 10:07 AM
Actually I'm still having some weird problems with this. If I open the material browser from Medit, the changes I make with mtlBrowser.browseFrom are applied. But if I open the dialog with materialBrowseDlg() it isn't always the case and the category is not changed. Any ideas how to fix this?
EDIT:
Okey, here is a way to replicate the situation:
-Open max
-Type following to maxscript listener, it works just fine
mtlBrowser.browseFrom #mtlEditor
materialBrowseDlg #mats
-Now, open material editor and click "Get Material" button, it opens similar material browser dialog.
-After this, mtlBrowser.browseFrom function does no longer apply changes to materialBrowseDlg dialog but to dialog you open from material editor. So following script no longer works.
mtlBrowser.browseFrom #scene
materialBrowseDlg #mats
-It opens mtlEditor mats not scene mats as it should.
To me this seems bug, am I correct or is it just some weird max freature?
CGTalk Moderation
01-02-2007, 10:07 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.