def _requestToonState(self, toonId, state, anim):
        if self.dancingToonFSMs.has_key(toonId):
            state = ToonDancingStates.getString(state)
            curState = self.dancingToonFSMs[toonId].getCurrentOrNextState()
            try:
                self.dancingToonFSMs[toonId].request(state, anim)
            except FSM.RequestDenied:
                self.notify.warning('could not go from state=%s to state %s' % (curState, state))

            if state == ToonDancingStates.getString(ToonDancingStates.Cleanup):
                self.notify.debug('deleting this fsm %s' % self.dancingToonFSMs[toonId])
                del self.dancingToonFSMs[toonId]
                if self.localToonDanceSequence:
                    self.notify.debug('forcing a finish of localToonDanceSequence')
                    self.localToonDanceSequence.finish()
                    self.localToonDanceSequence = None
    def _requestToonState(self, toonId, state, anim):
        if self.dancingToonFSMs.has_key(toonId):
            state = ToonDancingStates.getString(state)
            curState = self.dancingToonFSMs[toonId].getCurrentOrNextState()
            
            try:
                self.dancingToonFSMs[toonId].request(state, anim)
            except FSM.RequestDenied:
                self.notify.warning('could not go from state=%s to state %s' % (curState, state))

            if state == ToonDancingStates.getString(ToonDancingStates.Cleanup):
                self.notify.debug('deleting this fsm %s' % self.dancingToonFSMs[toonId])
                del self.dancingToonFSMs[toonId]
                if self.localToonDanceSequence:
                    self.notify.debug('forcing a finish of localToonDanceSequence')
                    self.localToonDanceSequence.finish()
                    self.localToonDanceSequence = None
Ejemplo n.º 3
0
 def _requestToonState(self, toonId, state, anim):
     if toonId in self.dancingToonFSMs:
         state = ToonDancingStates.getString(state)
         curState = self.dancingToonFSMs[toonId].getCurrentOrNextState()
         assert (self.notify.debug(
             "requestToonState toonId=%s, state=%s, anim=%s" %
             (toonId, state, anim)))
         try:
             self.dancingToonFSMs[toonId].request(state, anim)
         except FSM.RequestDenied:
             self.notify.warning("could not go from state=%s to state %s" %
                                 (curState, state))
         if state == ToonDancingStates.getString(ToonDancingStates.Cleanup):
             self.notify.debug("deleting this fsm %s" %
                               (self.dancingToonFSMs[toonId]))
             del self.dancingToonFSMs[toonId]
             # the local Toon dance sequence has camera reparents, which is bad if
             # we're not in the dance floor anymore.
             if self.localToonDanceSequence:
                 self.notify.debug(
                     "forcing a finish of localToonDanceSequence")
                 self.localToonDanceSequence.finish()
                 self.localToonDanceSequence = None