Преглед изворни кода

allow duration to imply endTime

David Rose пре 22 година
родитељ
комит
ac8bb40c69
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      direct/src/interval/ActorInterval.py

+ 5 - 0
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.