Skip to content

Instantly share code, notes, and snippets.

@andrewbunday
Created December 7, 2011 18:31
Show Gist options
  • Save andrewbunday/1444001 to your computer and use it in GitHub Desktop.
Save andrewbunday/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
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