def channelbox_menu_object(box, menu, *args):
cmds.menu(menu, e=1, deleteAllItems=1)
sel = cmds.ls(os=1)
if not sel:
cmds.menuItem(l="Nothing selected", p=menu)
return
sel.reverse()
first = 1
for i in sel:
m_item = cmds.menuItem(l=i, p=menu)
m_item_box = cmds.menuItem(m_item, optionBox=1, p=menu)
cmds.menuItem(m_item, e=1, c=sysCmd.rpartial(channelbox_command_objectmenu, box, menu, m_item, "select " + i))
cmds.menuItem(m_item_box, e=1, c=sysCmd.rpartial(channelbox_command_objectmenu, box, menu, m_item_box, m_item,
"select " + i + " [ ]"))
if first:
cmds.menuItem(divider=1, p=menu)
first = 0
# -----------------------------------------------------------------------------------#
# -----------------------------------------------------------------------------------#
# This is where the menu icons are setup
# You probably don't need to modify this, unless you have your own icons to add
# -----------------------------------------------------------------------------------#
评论列表
文章目录