[Closed] mtlBrowser.browseFrom, how does it work?
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:
[left]materialBrowseDlg [#mats] [#maps] [#incNone] [#instanceOnly]
[/left]
[left]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:
[/left]
[left]#mats
[/left]
[left]Display Materials only.
[/left]
[left]#maps
[/left]
[left]Display TextureMaps only.
[/left]
[left]#incNone
[/left]
[left]Include “None” as a Material and TextureMap.
[/left]
[left]#instanceOnly
[/left]
[left]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.
[/left]
[left]If neither #mats or #maps is specified, both Materials and TextureMaps are displayed. If both are specified, TextureMaps are displayed.
[/left]
[left]
[/left]
[left]mtlBrowser.browseFrom [#mtlLibrary | #mtlEditor | #activeSlot | #selected | #scene | #new]
[/left]
[left]Lets you set the Browse From: source for the modeless material browser.
[/left]
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…
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?