فهرست منبع

added getFrameTime

Samir Naik 20 سال پیش
والد
کامیت
40b95dfb56
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      direct/src/actor/Actor.py

+ 6 - 0
direct/src/actor/Actor.py

@@ -535,6 +535,12 @@ class Actor(PandaObject, NodePath):
         if len(controls) == 0:
             return None
         return controls[0].getNumFrames()
+
+    def getFrameTime(self, anim, frame):
+        numFrames = self.getNumFrames(anim)
+        animTime = self.getDuration(anim)
+        frameTime = animTime * float(frame) / numFrames
+        return frameTime
         
     def getCurrentAnim(self, partName=None):
         """