Skip to content

Instantly share code, notes, and snippets.

@robomojo
Created October 7, 2013 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robomojo/6876031 to your computer and use it in GitHub Desktop.
Save robomojo/6876031 to your computer and use it in GitHub Desktop.
some code to access maya shelves using pymel
import pymel.core as pm
import maya.mel as mel
topLevelShelf = mel.eval('string $m = $gShelfTopLevel')
shelves = pm.shelfTabLayout(topLevelShelf, query=True, tabLabelIndex=True)
for index, shelf in enumerate(shelves):
pm.optionVar(stringValue=('shelfName%d' % (index+1), str(shelf)))
# print shelf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment