当前位置: 首页>>代码示例>>Python>>正文


Python utils.executeDeferred函数代码示例

本文整理汇总了Python中maya.utils.executeDeferred函数的典型用法代码示例。如果您正苦于以下问题:Python executeDeferred函数的具体用法?Python executeDeferred怎么用?Python executeDeferred使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了executeDeferred函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的maya.utils.executeDeferred函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。