Subject: Re: general shelf gui question 2003-12-17 - By Bryan Ewert
Back ?from Tue, 16 Dec 2003 13:10:07 +0100
> Creating a shelf tab is simple, but how do I dynamically add buttons?
You can add a shelfButton at any time (as long as the UI exists), parented to your shelfTab:
// Do NOT create Shelf if running in batch mode, or // if Shelf UI is hidden! if ( !`about -batch` && isUIComponentVisible( "Shelf" ) ) { if (`shelfLayout -exists "MyShelf"`==0) { addNewShelfTab "MyShelf"; }
shelfButton -c "myShelfCommand" -p "MyShelf" -i1 "myIcon.bmp" -ann "My Command" -l "MyCommandButton"; } > How do I keep this from being stored in the userPrefs
As part of Maya's main shelf bar, you can't. In this case you will need to remove the shelf from the UI and preferences by calling:
deleteShelfTab MyShelf;
> I guess, I'm asking if there are ways to relatively easily build and > destroy shelf tabs and their buttons without dealing with userPrefs and > shelf*.mel files.
Check out myShelf.mel and Dirk's Connect Poly Shape toolbox for examples of using "tear-off" shelves that are not associated with Maya's prefs:
http://www.ewertb.com/maya/h2o/index.html
http://www.lightstorm3d.com/
-- Bryan Ewert ?maya@(protected) ?http://www.ewertb.com ?
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-archive: <http://www.highend3d.com/maya/devarchive/>
|
|