Created
December 7, 2011 18:31
-
-
Save andycodes00/1444001 to your computer and use it in GitHub Desktop.
This kinda thing really gets on my wick. Sometimes a plugin comes along which doesn't source it's own shelves. When that happens you have to hunt around in the file system to load the shelf. So instead popping this file into the scripts directory of the p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya | |
def bbLoadShelf(name, filepath=""): | |
mainShelfLayout = maya.mel.eval('global string $gShelfTopLevel; string $tmp=$gShelfTopLevel;') | |
labels = maya.cmds.tabLayout(mainShelfLayout, query=True, tabLabel=True) | |
if not name in labels: | |
maya.mel.eval('addNewShelfTab "%s"' % name) | |
maya.utils.executeDeferred( bbLoadShelf('MyPlugin') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment