本文整理汇总了Python中nuke.menu方法的典型用法代码示例。如果您正苦于以下问题:Python nuke.menu方法的具体用法?Python nuke.menu怎么用?Python nuke.menu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuke
的用法示例。
在下文中一共展示了nuke.menu方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_tools
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def create_tools(self, menu, type, name, command, shortcut, icon_name):
"""
create menu tools
:param type:
:param menu:
:param name:
:param command:
:param shortcut:
:param icon:
:return:
"""
if type == "python":
menu.addCommand(name, command, shortcut, icon=icon_name)
elif type == "gizmo":
menu.addCommand(name, "nuke.createNode(\"%s\")" % command, icon=icon_name)
elif type == "toolbar":
menu.addCommand(name, icon=icon_name)
示例2: uninstall
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def uninstall():
"""Uninstall all that was previously installed
This is where you undo everything that was done in `install()`.
That means, removing menus, deregistering families and data
and everything. It should be as though `install()` was never run,
because odds are calling this function means the user is interested
in re-installing shortly afterwards. If, for example, he has been
modifying the menu or registered families.
"""
_uninstall_menu()
pyblish.deregister_host("nuke")
示例3: _uninstall_menu
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def _uninstall_menu():
"""Uninstalling Avalon menu to Nuke
"""
menubar = nuke.menu("Nuke")
menubar.removeItem(api.Session["AVALON_LABEL"])
示例4: _on_task_changed
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def _on_task_changed(*args):
# Update menu
_uninstall_menu()
_install_menu()
# Backwards compatibility
示例5: add_commands
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def add_commands():
nuke.menu('Nodes').addCommand(
name='Image/WriteProduct',
command=create_write_product_node,
shortcut='w',
)
nuke.menu('Nodes').addCommand(
name='Image/ReadSub',
command=create_read_sub_node,
)
# -----------------------------------------------------------------------------
示例6: create_menus
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def create_menus(self):
import nuke
nuke_menu = nuke.menu('Nuke')
menu = nuke_menu.addMenu('Hotbox Designer')
hotkey_data = self.load_hotkey()
for name, value in hotkey_data.items():
menu.addCommand(
name='Hotboxes/{name}'.format(name=name),
command=str(value['command']), shortcut=value['sequence'])
示例7: create_menu
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def create_menu(self, name, icon_name):
"""
create nuke menu
:param name:
:param icon:
:return:
"""
tool_bar = nuke.menu('Nodes')
menu = tool_bar.addMenu(name, icon=icon_name)
return menu
示例8: add_bar_tools
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def add_bar_tools(self):
"""
add nuke menu tools
:return:
"""
toolbar_config = self.config["toolbar"]
for menus in toolbar_config:
# first create tool menu
menu_icon_name = toolbar_config[menus]['icon']
cmenu = self.create_menu(menus, menu_icon_name)
list = toolbar_config[menus]['list']
for tools in list:
# second add menu list
if tools["icon"]:
tools_icon = tools["icon"]
else:
tools_icon = ""
print tools_icon
self.create_tools(cmenu,
tools["type"],
tools["name"],
tools["command"],
tools["shortcut"],
tools_icon
)
示例9: add_menu_tools
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def add_menu_tools(self):
"""
add_menu_tools
:return:
"""
menubar = nuke.menu("Nuke")
toolMenu = menubar.addMenu('&Tools')
toolMenu_config = self.config["toolMenu"]
for tools in toolMenu_config:
self.create_menu_tools(toolMenu,
toolMenu_config[tools]["name"],
toolMenu_config[tools]["command"]
)
示例10: initializeMenu
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def initializeMenu(self, entries):
m = nuke.menu( 'Nuke' )
self.menu = m.addMenu( 'Perforce' )
示例11: addMenuDivider
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuDivider(self, label):
self.menu.addSeparator()
示例12: addMenuLabel
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuLabel(self, label):
tmp = self.menu.addCommand(label, lambda: None)
tmp.setEnabled(False)
示例13: addMenuSubmenu
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuSubmenu(self, label, iconPath, entries):
# Save our current menu
parent = self.menu
self.menu = parent.addMenu(label, icon=self.sanitizeIconPath(iconPath))
# Fill up the submenu
self.fillMenu(entries)
# Reset our current menu
self.menu = parent
示例14: addMenuCommand
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuCommand(self, label, iconPath, command):
self.menu.addCommand(label, command, icon=self.sanitizeIconPath(iconPath))
示例15: setup_cryptomatte_ui
# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def setup_cryptomatte_ui():
if nuke.GUI:
toolbar = nuke.menu("Nodes")
menu = toolbar.addMenu("Cryptomatte", "cryptomatte_logo.png",index=-1)
menu.addCommand("Cryptomatte", "import cryptomatte_utilities as cu; cu.cryptomatte_create_gizmo();")
menu.addCommand("Decryptomatte All", "import cryptomatte_utilities as cu; cu.decryptomatte_all();")
menu.addCommand("Decryptomatte Selection", "import cryptomatte_utilities as cu; cu.decryptomatte_selected();")
menu.addCommand("Encryptomatte", "import cryptomatte_utilities as cu; cu.encryptomatte_create_gizmo();")