Browse Source

workaround for zero-length interval bug?

David Rose 23 years ago
parent
commit
e4dc6de96f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      direct/src/interval/ActorInterval.py

+ 4 - 1
direct/src/interval/ActorInterval.py

@@ -64,7 +64,10 @@ class ActorInterval(Interval.Interval):
 
 
     def calcFrame(self, t):
     def calcFrame(self, t):
         segmentLength = abs(self.finishTime - self.startTime)
         segmentLength = abs(self.finishTime - self.startTime)
-        offset = t % segmentLength
+        if segmentLength == 0:
+            offset = 0
+        else:
+            offset = t % segmentLength
         # Handle boundary case where we want to set the final frame
         # Handle boundary case where we want to set the final frame
         if (t == self.getDuration() and offset < 0.0001):
         if (t == self.getDuration() and offset < 0.0001):
             offset = segmentLength
             offset = segmentLength