本文整理汇总了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
示例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)
示例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)
示例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)
#スピンボックスの数値を全選択する
示例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()
"""
))
示例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)
示例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()
"""
))
示例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))
示例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)
#スピンボックスの数値を全選択する
示例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()
"""
))