本文整理汇总了Python中maya.utils.executeDeferred函数的典型用法代码示例。如果您正苦于以下问题:Python executeDeferred函数的具体用法?Python executeDeferred怎么用?Python executeDeferred使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了executeDeferred函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: closeNextDialogWithResult
def closeNextDialogWithResult(result):
'''
close next modal dialog with given result
'''
if Utils.getMayaVersion()>=Utils.MAYA2011:
mUtils.executeDeferred(lambda:BaseDialog.currentDialog.closeDialogWithResult(result))
else:
Utils.displayError("hurray for maya 2009, close dialog manually with result "+result)
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:8,代码来源:testUtils.py
示例2: pumpQt
def pumpQt():
global app
def processor():
app.processEvents()
while 1:
time.sleep(0.01)
utils.executeDeferred( processor )
开发者ID:attila3d,项目名称:arsenalsuite,代码行数:8,代码来源:pumpThread.py
示例3: _close_parent_window
def _close_parent_window(self):
"""helper routine closing the parent window if there is one"""
p = self.parent()
if isinstance(p, ui.Window):
# If its not deferred, it will crash maya for some reason, maybe
# something related to garbage collection.
mutil.executeDeferred(self.parent().delete)
elif isinstance(p, ui.FormLayout) and p.startswith("layoutDialog"):
cmds.layoutDialog(dismiss="close")
开发者ID:mrv-developers,项目名称:mrv,代码行数:9,代码来源:layout.py
示例4: execute
def execute(self):
from maya import utils as mu
from ngSkinTools.ui.mainwindow import MainWindow
BaseToolWindow.closeAllWindows()
deleteCustomOptions()
mu.executeDeferred(MainWindow.open)
开发者ID:leandropim,项目名称:Tapp,代码行数:9,代码来源:actions.py
示例5: refreshWindow
def refreshWindow(*args):
layout_name = pm.rowColumnLayout(lights_layout, q=True, fpn=True)
utils.executeDeferred("import pymel.core as pm;pm.deleteUI('{0}')".format(layout_name))
lights_area()
ibl_list = pm.ls(type='mentalrayIblShape')
if ibl_list != []:
ibl_btn.setImage1(get_icon_path('deleteIBL_icon.png'))
else:
ibl_btn.setImage1(get_icon_path('IBL_icon.png'))
开发者ID:Huston94,项目名称:Simple_Lights_GUI,代码行数:10,代码来源:simple_lights_GUI.py
示例6: _confirm_button_pressed
def _confirm_button_pressed(self, *args):
if not self.stack.base_items:
raise ValueError("Please add at least one item to the stack and retry")
# END handle empty refs
# create refs
self._create_references(self.stack.base_items)
# finally let base take care of the rest
# NOTE: Needs to be deferred, crashes otherwis
mutil.executeDeferred(super(FileReferenceFinder, self)._confirm_button_pressed)
开发者ID:mrv-developers,项目名称:mrv,代码行数:11,代码来源:layout.py
示例7: _removeTrackingPoints
def _removeTrackingPoints(self):
self._track = False
for index, value in enumerate(self._tracking_points):
if value > 0:
self._tracking_points[index] -= 1
self._track = True
if self._track is False:
self._anim_follow_timer.stop()
utils.executeDeferred(self.update)
开发者ID:mikebourbeauart,项目名称:Tutorials,代码行数:11,代码来源:slider.py
示例8: _animateText
def _animateText(self):
stop_animating = True
for key, value in self._text_glow.items():
if value > 0:
stop_animating = False
self._text_glow[key] = value - 1
if stop_animating:
self._anim_timer.stop()
utils.executeDeferred(self.update)
开发者ID:utsdab,项目名称:usr,代码行数:11,代码来源:line_edit.py
示例9: execute
def execute(self):
from maya import utils as mu
from ngSkinTools.ui.mainwindow import MainWindow
BaseToolWindow.closeAllWindows()
variablePrefix = "ngSkinTools"
for varName in cmds.optionVar(list=True):
if varName.startswith(variablePrefix):
cmds.optionVar(remove=varName)
mu.executeDeferred(MainWindow.open)
开发者ID:BigMacchia,项目名称:ngSkinTools,代码行数:12,代码来源:actions.py
示例10: _animateGlow
def _animateGlow(self):
if self._hover:
if self._glow_index >= 10:
self._glow_index = 10
self._anim_timer.stop()
else:
self._glow_index += 1
else:
if self._glow_index <= 0:
self._glow_index = 0
self._anim_timer.stop()
else:
self._glow_index -= 1
utils.executeDeferred(self.update)
开发者ID:mikebourbeauart,项目名称:Tutorials,代码行数:16,代码来源:base.py
示例11: createTx
def createTx(self):
if not self.txManager.selectedFiles:
return
ctrlPath = '|'.join([self.txManager.window, 'groupBox_2', 'pushButton_7']);
utils.executeDeferred(cmds.button,ctrlPath, edit=True, enable=True);
for texture in self.txManager.selectedFiles:
if not texture:
continue;
# stopCreation has been called
if not self.txManager.process:
break;
# Process all the files that match the <udim> tag
if 'udim' in os.path.basename(texture):
udims = getUdims(texture)
for udim in udims:
# stopCreation has been called
if not self.txManager.process:
break;
if self.makeTx(udim) is 0:
self.filesCreated += 1
else:
self.createdErrors += 1
utils.executeDeferred(updateProgressMessage, self.txManager.window, self.filesCreated, self.txManager.filesToCreate, self.createdErrors)
else:
if self.makeTx(texture) is 0:
self.filesCreated += 1
else:
self.createdErrors += 1
utils.executeDeferred(updateProgressMessage, self.txManager.window, self.filesCreated, self.txManager.filesToCreate, self.createdErrors)
ctrlPath = '|'.join([self.txManager.window, 'groupBox_2', 'pushButton_7']);
utils.executeDeferred(cmds.button, ctrlPath, edit=True, enable=False);
self.txManager.process = True
utils.executeDeferred(self.txManager.updateList)
开发者ID:Quazo,项目名称:breakingpoint,代码行数:40,代码来源:txManager.py
示例12: deleteSnapShot
def deleteSnapShot( self, *args ):
print "Deleting snapshot"
import threading
import maya.utils as utils
cmds.undoInfo(openChunk = True)
try:
RenderLayerManagerFile.RenderLayerManagerClass.ShowModel(Visibility = False)
SnapShotClass.UpdateImagePlane("CMForegroundPlane", "persp")
#Call the destroy function from the snapshot class to remove the class objects
SnapShotClass.SnapShots.pop( self.CurrentIndex ).destroy()
#Update all names
for i in range( self.CurrentIndex, len( SnapShotClass.SnapShots )):
SnapShotClass.SnapShots[i].UpdateIndex( i )
#Check to see if there is a signature image in the current list
SignatureFound = False
for i in SnapShotClass.SnapShots:
if cmds.getAttr(i.Camera +'.CMSignature'):
SignatureFound = True
SnapShotClass.UpdateImagePlane("CMForegroundPlane", i.Camera)
#If not make the first image the signature
if not SignatureFound and cmds.objExists("shot_0"):
cmds.setAttr('shot_0.CMSignature', True)
SnapShotClass.UpdateImagePlane("CMForegroundPlane", "shot_0")
#Adjust render layer adjustments
RenderLayerManagerFile.RenderLayerManagerClass.assignSnapShots("shot_0")
#Wait for the function to complete otherwise a memory error will crash maya
threading.Thread(target=utils.executeDeferred(SnapShotClass.RecreateUI)).start()
RenderLayerManagerFile.RenderLayerManagerClass.ShowModel(Visibility = True)
except:
raise
finally:
cmds.undoInfo(closeChunk = True)
print "Snapshot deleted"
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:45,代码来源:SnapShotFile.py
示例13: deleteTurntable
def deleteTurntable( self, *args ):
import threading
import maya.utils as utils
cmds.undoInfo(openChunk = True)
#Call the destroy function from the turntable class to remove the class objects
TurntableClass.Turntables.pop( self.CurrentIndex ).destroy()
#Update all names
for i in range( self.CurrentIndex, len( TurntableClass.Turntables )):
TurntableClass.Turntables[i].Update( i )
#Wait for the function to complete otherwise a memory error will crash maya
threading.Thread(utils.executeDeferred(TurntableClass.RecreateUI)).start()
cmds.undoInfo(closeChunk = True)
开发者ID:Kif11,项目名称:turbosquid_maya_publisher,代码行数:18,代码来源:TurntableFile.py
示例14: onClose
pm.optionVar (fv=("gridSpacing",100))
mc.displayColor('gridAxis', 2, dormant=True)
mc.displayColor('gridHighlight', 1, dormant=True)
mc.displayColor('grid', 3, dormant=True)
#setting the units
pm.optionVar (sv=("workingUnitLinear", "cm"))
pm.optionVar (sv=("workingUnitLinearDefault", "cm"))
def onClose():
if 'FTRACK_TASKID' in os.environ.keys():
session = ftrack_api.Session(
server_url=os.environ['FTRACK_SERVER'],
api_user=os.environ['FTRACK_API_USER'],
api_key=os.environ['FTRACK_API_KEY']
)
task = session.query('Task where id is %s' % os.environ['FTRACK_TASKID'])
user = session.query('User where username is %s' % os.environ['FTRACK_API_USER']).one()
user.stop_timer()
def addQuitAppCallback():
mc.scriptJob(e=["quitApplication", "onClose()"])
if maya.OpenMaya.MGlobal.mayaState() == 0:
mc.evalDeferred("loadAndInit()")
executeDeferred("addQuitAppCallback()")
开发者ID:afrocircus,项目名称:LVFX-pipeline,代码行数:30,代码来源:userSetup.py
示例15: end
def end( self ):
"""Close the progress window"""
# damn, has to be deferred to actually work
super( ProgressWindow, self ).end( )
mutils.executeDeferred( cmds.progressWindow, ep=1 )
开发者ID:adamcobabe,项目名称:mrv,代码行数:5,代码来源:dialog.py
示例16: __deleteRenderViewHideDockControl
def __deleteRenderViewHideDockControl(*args):
# If it's made visible we hide it and delete it.
# We use executeDeferred because otherwise we'll get a fatal error. :)
if mc.dockControl(UI_OBJ, q=1, visible=True):
mc.dockControl(UI_OBJ, e=1, visible=False)
mutils.executeDeferred(lambda: mc.deleteUI(UI_OBJ))
开发者ID:BigRoy,项目名称:mayaVrayCommandDocs,代码行数:6,代码来源:forceHideRenderView.py
示例17: Copyright
import maya.cmds as cmds
import maya.OpenMaya as openMaya
import maya.utils as utils
utils.executeDeferred ('import pythonScripts; pythonScripts.pythonScripts()')
# Copyright (C) 1997-2006 Autodesk, Inc., and/or its licensors.
# All rights reserved.
#
# The coded instructions, statements, computer programs, and/or related
# material (collectively the "Data") in these files contain unpublished
# information proprietary to Autodesk, Inc. ("Autodesk") and/or its licensors,
# which is protected by U.S. and Canadian federal copyright law and by
# international treaties.
#
# The Data is provided for use exclusively by You. You have the right to use,
# modify, and incorporate this Data into other products for purposes authorized
# by the Autodesk software license agreement, without fee.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. AUTODESK
# DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTIES
# INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF NON-INFRINGEMENT,
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE
# OF DEALING, USAGE, OR TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS
# LICENSORS BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL,
# DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK AND/OR ITS
# LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY OR PROBABILITY OF SUCH DAMAGES.
开发者ID:DimondTheCat,项目名称:xray,代码行数:26,代码来源:userSetup.py
示例18: go
def go():
while s.playing:
s.limit.acquire()
utils.executeDeferred(s.tick)
time.sleep(1)
开发者ID:internetimagery,项目名称:clipStore,代码行数:5,代码来源:clips.py
示例19: set
def set(s, k, v):
s.data[k] = v
s.info["TODO_SETTINGS"] = json.dumps(s.data)
if s.update:
utils.executeDeferred(s.update)
开发者ID:internetimagery,项目名称:todo,代码行数:5,代码来源:Original.__init__.py
示例20: deferred
def deferred(*args, **kwargs):
executeDeferred(fn, *args, **kwargs)
开发者ID:cpenv,项目名称:maya_module,代码行数:2,代码来源:userHotkeys.py
注:本文中的maya.utils.executeDeferred函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论