소스 검색

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):
         """