(self, action)
| 1344 | # RpcName: updateTime => pv.vcr.action |
| 1345 | @exportRpc("pv.vcr.action") |
| 1346 | def updateTime(self, action): |
| 1347 | view = simple.GetRenderView() |
| 1348 | animationScene = simple.GetAnimationScene() |
| 1349 | currentTime = view.ViewTime |
| 1350 | |
| 1351 | if action == "next": |
| 1352 | animationScene.GoToNext() |
| 1353 | if currentTime == view.ViewTime: |
| 1354 | animationScene.GoToFirst() |
| 1355 | if action == "prev": |
| 1356 | animationScene.GoToPrevious() |
| 1357 | if currentTime == view.ViewTime: |
| 1358 | animationScene.GoToLast() |
| 1359 | if action == "first": |
| 1360 | animationScene.GoToFirst() |
| 1361 | if action == "last": |
| 1362 | animationScene.GoToLast() |
| 1363 | |
| 1364 | timestep = list(animationScene.TimeKeeper.TimestepValues).index( |
| 1365 | animationScene.TimeKeeper.Time |
| 1366 | ) |
| 1367 | self.publish( |
| 1368 | "pv.time.change", {"time": float(view.ViewTime), "timeStep": timestep} |
| 1369 | ) |
| 1370 | |
| 1371 | self.getApplication().InvokeEvent("UpdateEvent") |
| 1372 | |
| 1373 | return view.ViewTime |
| 1374 | |
| 1375 | @exportRpc("pv.time.index.set") |
| 1376 | def setTimeStep(self, timeIdx): |
no test coverage detected