Пример #1
0
 def clearing(self):
     self.clearCBs()
     try:
         MMessage.removeCallback(self.afterNewSceneCBId)
         MMessage.removeCallback(self.afterOpenSceneCBId)
     except:
         pass
Пример #2
0
    def disconnectCallback(self, signal):
        """
		Disconnect a single callback when it is no longer used. Called 
		when the last signal for this callback is disconnected.
		"""
        if signal in self._callbackMap:
            callback = self._callbackMap.pop(signal)
            #			print 'disconnectCallback', signal
            MMessage.removeCallback(callback)
Пример #3
0
	def disconnectCallback(self, signal):
		"""
		Disconnect a single callback when it is no longer used. Called 
		when the last signal for this callback is disconnected.
		"""
		if signal in self._callbackMap:
			callback = self._callbackMap.pop(signal)
#			print 'disconnectCallback', signal
			MMessage.removeCallback(callback)
Пример #4
0
    def clearing(self):
        """Clearing method called from maya menu"""

        self.clearCBs()
        try:
            MMessage.removeCallback(self.afterNewSceneCBId)
            MMessage.removeCallback(self.afterOpenSceneCBId)
        except:
            pass
Пример #5
0
 def clearCBs(self, event=None):
     try:
         print "removing scriptjob"
         cmds.scriptJob(kill=self.layerChangedJob, force=True)
         for cache in self.ABCViewerNode.values():
             cache.setSelection("")
         print "removing callbacks"
         MMessage.removeCallback(self.newNodeCBMsgId)
         MMessage.removeCallback(self.delNodeCBMsgId)
         MNodeMessage.removeCallback(self.NodeNameMsgId)
     except:
         pass
Пример #6
0
 def clearCBs(self, event=None):
     try:
         print "removing scriptjob"
         cmds.scriptJob( kill=self.layerChangedJob, force=True)
         for cache in self.ABCViewerNode.values():
             cache.setSelection("")
         print "removing callbacks"
         MMessage.removeCallback( self.newNodeCBMsgId )
         MMessage.removeCallback( self.delNodeCBMsgId )
         MNodeMessage.removeCallback( self.NodeNameMsgId )
     except:
         pass
Пример #7
0
    def set_callback(self, state):
        """
        Toggle selection event callback
        :param state: checkbox's state
        :type  state: bool | int
        """
        if state and not self.callback:
            self.callback = MEventMessage.addEventCallback('SelectionChanged', self.update_attributes)
            self.update_attributes(cmds.ls(sl=True))

        elif not state and self.callback:
            MMessage.removeCallback(self.callback)
            self.callback = None
Пример #8
0
    def set_callback(self, state):
        """
        Toggle selection event callback
        :param state: checkbox's state
        :type  state: bool | int
        """
        if state and not self.callback:
            self.callback = MEventMessage.addEventCallback(
                'SelectionChanged', self.update_attributes)
            self.update_attributes(cmds.ls(sl=True))

        elif not state and self.callback:
            MMessage.removeCallback(self.callback)
            self.callback = None
Пример #9
0
 def __exit__(self, *args):
     MMessage.removeCallback(self.cbid)
Пример #10
0
    def clearing(self):
        self.clearCBs()

        MMessage.removeCallback( self.afterNewSceneCBId )
        MMessage.removeCallback( self.afterOpenSceneCBId )