当前位置: 首页>>代码示例>>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;未经允许,请勿转载。