Check camera timestamp (#431)

check camera timestamp
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-14 00:09:47 -07:00
1 parent cdb68aef60
commit 587e641884
3 files changed
+11 -2

No files matched your search

+7
View File
@@ -235,6 +235,7 @@ class VisualizerState:
self.static_fps = 1
self.moving_fps = 24
self.camera_moving = False
self.prev_camera_timestamp = 0
self.outputs_set = False
@@ -525,6 +526,12 @@ class VisualizerState:
Args:
graph: current checkpoint of model
"""
# Check that timestamp is newer than the last one
if int(camera_object["timestamp"]) < self.prev_camera_timestamp:
return
self.prev_camera_timestamp = int(camera_object["timestamp"])
# check and perform output type updates
output_type = self.vis["renderingState/output_choice"].read()
output_type = OutputTypes.INIT if output_type is None else output_type