Deprecation error in CInterval

OK, when I call myinterval.stop(), I get a deprecation error. I can’t see in the API docs which method replaces this.

How do one start and stop intervals without getting the deprecation warnings/errors.

Thanks,

Christian

    def EndMove(self):
        ''' Add the distance traveled to self.traveled and abort the self.moveinterval if necessary
        ''' 
        self.traveled += (self.moveinterval.getT()/self.moveinterval.getDuration())  * self.__steptravel
        if self.moveinterval.isPlaying():
            self.moveinterval.stop()

www.panda3d.org/manual/index.php/Intervals:

The problem with finish() is that it “teleport” the object to the end of the interval instead of stopping it where it is.

I just figured out that:

T = myinterval.getT()
myinterval.finish()
myinterval.setT( T )

works, but this is in no way as elegant as

myinterval.stop()

was.

myInterval.pause()? Not sure if that will call the cleanup functions that .finish() supposedly calls though.

pause() is the correct way to stop an interval without doing all of the stuff at the end of the interval. finish() is the correct way to stop an inverval and guarantee that the stuff at the end of the interval is done.

Many years ago, we discovered that programmers were confused about whether the final actions of the interval would be done when they called stop(). So we removed stop() and replaced it with finish() and pause(), whose names were chosen to make it perfectly clear whether they perform the remaining actions or not.

It is perfectly acceptable to pause an interval and never resume it.

David

pause() does make sense. Thanks.

The confusion will be gone when stop() is retired.

Christian