mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
1 parent
cdb68aef60
commit
587e641884
3 files changed
+11
-2
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "viewer",
|
"name": "viewer",
|
||||||
"homepage": ".",
|
"homepage": ".",
|
||||||
"version": "22-09-13-0",
|
"version": "22-09-14-0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.10.4",
|
"@emotion/react": "^11.10.4",
|
||||||
|
|||||||
@@ -152,10 +152,12 @@ export default function ViewerWindow(props) {
|
|||||||
if (websocket.readyState === WebSocket.OPEN) {
|
if (websocket.readyState === WebSocket.OPEN) {
|
||||||
const cmd = 'write';
|
const cmd = 'write';
|
||||||
const path = 'renderingState/camera';
|
const path = 'renderingState/camera';
|
||||||
|
const data_packet = sceneTree.metadata.camera.toJSON();
|
||||||
|
data_packet.object.timestamp = +new Date();
|
||||||
const data = {
|
const data = {
|
||||||
type: cmd,
|
type: cmd,
|
||||||
path,
|
path,
|
||||||
data: sceneTree.metadata.camera.toJSON(),
|
data: data_packet,
|
||||||
};
|
};
|
||||||
const message = msgpack.encode(data);
|
const message = msgpack.encode(data);
|
||||||
websocket.send(message);
|
websocket.send(message);
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ class VisualizerState:
|
|||||||
self.static_fps = 1
|
self.static_fps = 1
|
||||||
self.moving_fps = 24
|
self.moving_fps = 24
|
||||||
self.camera_moving = False
|
self.camera_moving = False
|
||||||
|
self.prev_camera_timestamp = 0
|
||||||
|
|
||||||
self.outputs_set = False
|
self.outputs_set = False
|
||||||
|
|
||||||
@@ -525,6 +526,12 @@ class VisualizerState:
|
|||||||
Args:
|
Args:
|
||||||
graph: current checkpoint of model
|
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
|
# check and perform output type updates
|
||||||
output_type = self.vis["renderingState/output_choice"].read()
|
output_type = self.vis["renderingState/output_choice"].read()
|
||||||
output_type = OutputTypes.INIT if output_type is None else output_type
|
output_type = OutputTypes.INIT if output_type is None else output_type
|
||||||
|
|||||||
Reference in new issue
Block a user