當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。