From f4d998e214d5b825c3f78b97d220a74262a0985d Mon Sep 17 00:00:00 2001 From: Redmond Urbino Date: Wed, 24 Jan 2007 23:05:55 +0000 Subject: [PATCH] add getCurrentFrame, used in toontown vine game --- direct/src/interval/ActorInterval.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/direct/src/interval/ActorInterval.py b/direct/src/interval/ActorInterval.py index d3cd9bfdd5..920efb2cdd 100644 --- a/direct/src/interval/ActorInterval.py +++ b/direct/src/interval/ActorInterval.py @@ -118,6 +118,18 @@ class ActorInterval(Interval.Interval): # Initialize superclass Interval.Interval.__init__(self, name, duration) + def getCurrentFrame(self): + """Calculate the current frame playing in this interval. + + returns a float value between startFrame and endFrame, inclusive + returns None if there are any problems + """ + retval = None + if not self.isStopped(): + framesPlayed = self.numFrames * self.currT + retval = self.startFrame + framesPlayed + return retval + def privStep(self, t): frameCount = t * self.frameRate if self.constrainedLoop: