Python maya.cmds 模块,evalDeferred() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用maya.cmds.evalDeferred()

项目:SceneExplorer    作者:mochio326    | 项目源码 | 文件源码
def __register_scnexpl_startup():
    from textwrap import dedent
    cmds.evalDeferred(dedent(
        """
        import scnexpl.startup as s

        s.execute()
        """
    ))
项目:SiShelf    作者:mochio326    | 项目源码 | 文件源码
def __register_sishelf_startup():
    from textwrap import dedent
    cmds.evalDeferred(dedent(
        """
        import sishelf.startup as s

        s.execute()
        """
    ))
项目:ModularChannelBox    作者:Vaei    | 项目源码 | 文件源码
def channelbox_command_animCurve(box, menuItem, key, *args):
    with sysCmd.Undo(0):
        mel.eval("GraphEditor;")
        cmds.selectionConnection("graphEditor1FromOutliner", e=1, clear=1)
        # in case graph editor is open already, clear selection
        sel_attrs = channelBox_SelectedPlugs(box)
        if sel_attrs:
            for i in sel_attrs:
                cmds.evalDeferred(
                    "cmds.selectionConnection('graphEditor1FromOutliner', e = 1, select =\"" + i + "\")")
                # evalDeferred allows occurring graph editor opens, else selection occurs before element exists
项目:ml_tools    作者:morganloomis    | 项目源码 | 文件源码
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))