From ac8bb40c69cdc3d8967f3c56ca2add86649a9f6f Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 13 Nov 2003 05:49:49 +0000 Subject: [PATCH] allow duration to imply endTime --- direct/src/interval/ActorInterval.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direct/src/interval/ActorInterval.py b/direct/src/interval/ActorInterval.py index 4f0a3daa6e..83057a5053 100644 --- a/direct/src/interval/ActorInterval.py +++ b/direct/src/interval/ActorInterval.py @@ -71,6 +71,11 @@ class ActorInterval(Interval.Interval): self.endFrame = endFrame elif endTime != None: self.endFrame = int(math.floor(endTime * self.frameRate + 0.0001)) + elif duration != None: + if startTime == None: + startTime = float(self.startFrame) / float(self.frameRate) + endTime = startTime + duration + self.endFrame = int(math.floor(duration * self.frameRate + 0.0001)) else: # No end frame specified. Choose the maximum of all # of the controls' numbers of frames.