def to_shelf(action):
"""
Copy clicked menu item to the currently active Maya shelf
:param action: the action instance which is clicked
:type action: QtGui.QAction
:return: None
"""
shelftoplevel = mel.eval("$gShelfTopLevel = $gShelfTopLevel;")
current_active_shelf = cmds.tabLayout(shelftoplevel,
query=True,
selectTab=True)
cmds.shelfButton(command=action.process_command(),
sourceType="python",
parent=current_active_shelf,
image=action.iconfile or "pythonFamily.png",
annotation=action.statusTip(),
imageOverlayLabel=action.label or "")
评论列表
文章目录