![]() '''Adds a sub menu item with the specified label and icon to the specified parent popup menu.''' Return nuItem(p=parent, l=label, c=command, i='')ĭef addSubMenu(self, parent, label, icon=None): ![]() '''Adds a shelf button with the specified label, command, double click command and image.'''Ĭmds.shelfButton(width=37, height=37, image=icon, l=label, command=command, dcc=doubleCommand, imageOverlayLabel=label, olb=self.labelBackground, olc=self.labelColour)ĭef addMenuItem(self, parent, label, command=_null, icon=''): Otherwise, nothing is added to the shelf.'''ĭef addButon(self, label, icon='wip_32.png', command=_null, doubleCommand=_null): '''This method should be overwritten in derived classes to actually build the shelfĮlements. Self.iconPath = 'L:/_tech/media/icons/maya_shelfs/'īEWARE shelf name must be unique as it will replace any shelf with same name.īEWARE Do not use any space character ' ' in the name as maya will freack out It should be extended by the derived class to build the necessary shelf elements.īy default it creates an empty shelf called 'WIP'.īEWARE Do not use any space character ' ' in the name as Maya will freack out. If I create a button in the shelf with those methods, clicking it will crash maya.ĭo you have an idea how I can let my users reload my shelf, without the need to give them scripts to launch in the script editor?Ī simple class to build shelves in maya. This works perfectly when used from the script editor. ![]() ![]() To reload the shelf when developping or debugging, I create an instance of my subclass, then call I created a shelf in Maya 2019, using this good ol’ Super Class that I found here years ago:Įverything works well, except that I can’t reload the shelf using a button from the shelf: this instantly makes maya crash, without any error prompt/window. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |