当前位置: 首页>>代码示例>>Python>>正文


Python nuke.menu方法代码示例

本文整理汇总了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) 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:19,代码来源:menu.py

示例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") 
开发者ID:getavalon,项目名称:core,代码行数:17,代码来源:pipeline.py

示例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"]) 
开发者ID:getavalon,项目名称:core,代码行数:7,代码来源:pipeline.py

示例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 
开发者ID:getavalon,项目名称:core,代码行数:10,代码来源:pipeline.py

示例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,
    )

# ----------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:16,代码来源:nodes.py

示例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']) 
开发者ID:luckylyk,项目名称:hotbox_designer,代码行数:11,代码来源:applications.py

示例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 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:12,代码来源:menu.py

示例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
                                  ) 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:28,代码来源:menu.py

示例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"]
                                   ) 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:15,代码来源:menu.py

示例10: initializeMenu

# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def initializeMenu(self, entries):
        m = nuke.menu( 'Nuke' )
        self.menu = m.addMenu( 'Perforce' ) 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:5,代码来源:interop.py

示例11: addMenuDivider

# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuDivider(self, label):
        self.menu.addSeparator() 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:4,代码来源:interop.py

示例12: addMenuLabel

# 需要导入模块: import nuke [as 别名]
# 或者: from nuke import menu [as 别名]
def addMenuLabel(self, label):
        tmp = self.menu.addCommand(label, lambda: None)
        tmp.setEnabled(False) 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:5,代码来源:interop.py

示例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 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:12,代码来源:interop.py

示例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)) 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:4,代码来源:interop.py

示例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();") 
开发者ID:Psyop,项目名称:Cryptomatte,代码行数:10,代码来源:cryptomatte_utilities.py


注:本文中的nuke.menu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。