def buttonWithPopup(self, label=None, command=None, annotation='', shelfLabel='', shelfIcon='render_useBackground', readUI_toArgs={}):
'''
Create a button and attach a popup menu to a control with options to create a shelf button or a hotkey.
The argCommand should return a kwargs dictionary that can be used as args for the main command.
'''
if self.icon:
shelfIcon = self.icon
if annotation and not annotation.endswith('.'):
annotation+='.'
button = mc.button(label=label, command=command, annotation=annotation+' Or right click for more options.')
mc.popupMenu()
self.shelfMenuItem(command=command, annotation=annotation, shelfLabel=shelfLabel, shelfIcon=shelfIcon)
self.hotkeyMenuItem(command=command, annotation=annotation)
return button
评论列表
文章目录