當前位置: 首頁>>代碼示例>>Python>>正文


Python cmds.evalDeferred方法代碼示例

本文整理匯總了Python中maya.cmds.evalDeferred方法的典型用法代碼示例。如果您正苦於以下問題:Python cmds.evalDeferred方法的具體用法?Python cmds.evalDeferred怎麽用?Python cmds.evalDeferred使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在maya.cmds的用法示例。


在下文中一共展示了cmds.evalDeferred方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: eventFilter

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def eventFilter(self, obj, event):
        if event.type() == QEvent.FocusIn:
            self.sel_all_input()
            self.focused.emit()
        if event.type() == QEvent.Wheel:
            delta = event.delta()
            delta /= abs(delta)
            shift_mod = self.check_shift_modifiers()
            ctrl_mod = self.check_ctrl_modifiers()
            if shift_mod:
                self.setValue(self.value()+delta/10.0)
            elif ctrl_mod:
                self.setValue(self.value()+delta*10.0)
            else:
                self.setValue(self.value()+delta)
            cmds.evalDeferred(self.emit_wheel_event)
        if event.type() == QEvent.KeyPress:
            self.keypressed.emit()
        if event.type() == QEvent.MouseButtonPress:
            self.mousepressed.emit()
        return False 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:23,代碼來源:qt.py

示例2: add_to_filemenu

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def add_to_filemenu():
    """Add Pyblish to file-menu

    .. note:: We're going a bit hacky here, probably due to my lack
        of understanding for `evalDeferred` or `executeDeferred`,
        so if you can think of a better solution, feel free to edit.

    """

    if hasattr(cmds, 'about') and not cmds.about(batch=True):
        # As Maya builds its menus dynamically upon being accessed,
        # we force its build here prior to adding our entry using it's
        # native mel function call.
        mel.eval("evalDeferred buildFileMenu")

        # Serialise function into string
        script = inspect.getsource(_add_to_filemenu)
        script += "\n_add_to_filemenu()"

        # If cmds doesn't have any members, we're most likely in an
        # uninitialized batch-mode. It it does exists, ensure we
        # really aren't in batch mode.
        cmds.evalDeferred(script) 
開發者ID:pyblish,項目名稱:pyblish-maya,代碼行數:25,代碼來源:lib.py

示例3: jobReloadUI

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def jobReloadUI(self, *args):
        """ This scriptJob active when we got one new scene in order to reload the UI.
        """
        import maya.cmds as cmds
        cmds.select(clear=True)
        cmds.evalDeferred("import sys; sys.modules['dpAutoRigSystem.dpAutoRig'].DP_AutoRig_UI()", lowestPriority=True) 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:8,代碼來源:dpAutoRig.py

示例4: sel_all_input

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def sel_all_input(self):
        cmds.evalDeferred(self.select_box_all)
        
    #スピンボックスの數値を全選択する 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:6,代碼來源:qt.py

示例5: __register_sisidebar_startup

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def __register_sisidebar_startup():
    from textwrap import dedent
    cmds.evalDeferred(dedent(
        """
        import sisidebar.startup as s

        s.execute()
        """
    )) 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:11,代碼來源:userSetup.py

示例6: _add_to_filemenu

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def _add_to_filemenu():
    """Helper function for the above :func:add_to_filemenu()

    This function is serialised into a string and passed on
    to evalDeferred above.

    """

    import os
    import pyblish
    from maya import cmds

    # This must be duplicated here, due to this function
    # not being available through the above `evalDeferred`
    for item in ("pyblishOpeningDivider",
                 "pyblishScene",
                 "pyblishCloseDivider"):
        if cmds.menuItem(item, exists=True):
            cmds.deleteUI(item, menuItem=True)

    icon = os.path.dirname(pyblish.__file__)
    icon = os.path.join(icon, "icons", "logo-32x32.svg")

    cmds.menuItem("pyblishOpeningDivider",
                  divider=True,
                  insertAfter="saveAsOptions",
                  parent="mainFileMenu")

    cmds.menuItem("pyblishScene",
                  insertAfter="pyblishOpeningDivider",
                  label="Publish",
                  parent="mainFileMenu",
                  image=icon,
                  command="import pyblish_maya;pyblish_maya.show()")

    cmds.menuItem("pyblishCloseDivider",
                  insertAfter="pyblishScene",
                  parent="mainFileMenu",
                  divider=True) 
開發者ID:pyblish,項目名稱:pyblish-maya,代碼行數:41,代碼來源:lib.py

示例7: __register_sishelf_startup

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def __register_sishelf_startup():
    from textwrap import dedent
    cmds.evalDeferred(dedent(
        """
        import sishelf.startup as s

        s.execute()
        """
    )) 
開發者ID:mochio326,項目名稱:SiShelf,代碼行數:11,代碼來源:userSetup.py

示例8: deselectChannels

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def deselectChannels():
    '''
    Deselect selected channels in the channelBox
    by clearing selection and then re-selecting
    '''

    if not getSelectedChannels():
        return
    sel = mc.ls(sl=True)
    mc.select(clear=True)
    mc.evalDeferred(partial(mc.select,sel)) 
開發者ID:morganloomis,項目名稱:ml_tools,代碼行數:13,代碼來源:ml_utilities.py

示例9: sel_all_input

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def sel_all_input(self):
        cmds.evalDeferred(self.select_box_all)
    #スピンボックスの數値を全選択する 
開發者ID:ShikouYamaue,項目名稱:SIWeightEditor,代碼行數:5,代碼來源:qt.py

示例10: __register_siweighteditor_startup

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import evalDeferred [as 別名]
def __register_siweighteditor_startup():
    from textwrap import dedent
    cmds.evalDeferred(dedent(
        """
        import siweighteditor.startup as s

        s.execute()
        """
    )) 
開發者ID:ShikouYamaue,項目名稱:SIWeightEditor,代碼行數:11,代碼來源:userSetup.py


注:本文中的maya.cmds.evalDeferred方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。