def create_shelf():
'''Create the bns shelf'''
tab_layout = mel.eval('$pytmp=$gShelfTopLevel')
shelf_exists = cmds.shelfLayout(SHELF_NAME, exists=True)
if shelf_exists:
cmds.deleteUI(SHELF_NAME, layout=True)
shelf = cmds.shelfLayout(SHELF_NAME, parent=tab_layout)
for button, kwargs in SHELF_BUTTONS.items():
try:
img = QtGui.QImage(kwargs['image'])
kwargs['width'] = img.width()
kwargs['height'] = img.height()
cmds.shelfButton(label=button, parent=shelf, **kwargs)
except:
print button + ' failed...'
print kwargs
评论列表
文章目录