Sequences

I have a sequence (shown in code below) which seems to be working perfectly, yet when I try to call finish() on it, it runs one of the functions appended to it. The function is Func(messenger.send, ‘exittomenu’)).

def podSequence(self):
        self.podSeq = Sequence()
        self.podSeq.append(LerpPosInterval(self.podNode,
                                            ZONE_TIME,
                                            self.endNode.getPos(render),
                                            self.podNode.getPos()))
        self.podSeq.append(Func(self.endZoneShipNode.show))
        self.podSeq.append(LerpColorInterval(self.endZoneShipNode,
                                                10.0,
                                                Vec4(1, 1, 1, 1),
                                                Vec4(1, 1, 1, 0),
                                                ))
        self.podSeq.append(Wait(6.0))
        self.podSeq.append(Func(self.endZone))
        self.podSeq.append(Wait(6.5))
        
        # This is the problem line
        self.podSeq.append(Func(messenger.send, 'exittomenu'))
        
        self.podSeq.start()
        self.sequenceList.append(self.podSeq)

As you can see, many lerps and other stuff are appended, but the only thing that seems to be firing upon a finish() is that messenger call. I am finishing the Sequence in the class’ cleanUp function below (Note that all sequences are in the list self.sequenceList)

def cleanUp(self):
        print "ZONE TWO CLEANUP"
        taskMgr.remove('SpawnAI')

        taskMgr.remove('Check Distance')

        for seq in self.sequenceList:
            seq.finish()
            del seq
        del self.sequenceList
        print "DEBUG"

        self.cockpitNode.removeNode()
        self.zoneTwo.removeNode()
        self.zoneImage.removeNode()
        self.pod.cleanUp()
        del self.player

I have tested commenting out the “del seq” line, but no dice there, and finishing the sequence is mandatory.

Thanks for any help.

Which is the problem: that it is calling the exittomenu func, or that it isn’t calling the other func?

When you finish() an interval, it means to immediately skip the interval to the end, and do any of the actions between the current time position and the end of the interval. If you have already passed any funcs, it won’t do those again. Any lerps will be moved to their final positions.

If you don’t want this behavior, call pause() instead of finish().

David

Sorry, the problem is that it is calling the exittomenu function. The functionality I was assuming from finish() was that it would just kill the sequence and abort any further function calls.

That’s what I needed to know, thanks.