(time)
| 914 | |
| 915 | |
| 916 | def getFrameFromAnimationTime(time): |
| 917 | if not getReader(): |
| 918 | return -1 |
| 919 | |
| 920 | index = bisect.bisect_right(getAnimationScene().TimeKeeper.TimestepValues, time) |
| 921 | if index > 0: |
| 922 | previousTime = getAnimationScene().TimeKeeper.TimestepValues[index - 1] |
| 923 | nextTime = getAnimationScene().TimeKeeper.TimestepValues[index] |
| 924 | index = index - 1 if (abs(previousTime - time) < abs(nextTime - time)) else index |
| 925 | return index |
| 926 | |
| 927 | |
| 928 | def onSaveScreenshot(): |
no test coverage detected