diff --git a/app/src/App.tsx b/app/src/App.tsx index 245c0517..d0cc2545 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -157,6 +157,8 @@ export default function App() { setStep(parseInt(data) - 1); // reset selected ids setSelectedIds(new Set()); + } else if (roomConfig.scene.frame_update) { + setStep(parseInt(data) - 1); } setLength(data); }); @@ -166,7 +168,7 @@ export default function App() { return () => { socket.off("room:frames:refresh", onFramesRefresh); }; - }, [step]); + }, [step, roomConfig.scene]); useEffect(() => { function onConnect() { diff --git a/zndraw/scene.py b/zndraw/scene.py index c49621ec..43a0a01d 100644 --- a/zndraw/scene.py +++ b/zndraw/scene.py @@ -59,6 +59,10 @@ class Scene(BaseModel): camera_far: float = Field( 1000, ge=1, le=10000, description="Camera far rendering plane" ) + frame_update: bool = Field( + True, + description="Jump to updated frames.", + ) # bonds: bool = Field( # True, # description="Show bonds.", @@ -110,6 +114,7 @@ def get_updated_schema(cls) -> dict: schema["properties"]["Animation Loop"]["format"] = "checkbox" schema["properties"]["simulation_box"]["format"] = "checkbox" schema["properties"]["vectorfield"]["format"] = "checkbox" + schema["properties"]["frame_update"]["format"] = "checkbox" # schema["properties"]["resolution"]["format"] = "range" # schema["properties"]["label_offset"]["format"] = "range" schema["properties"]["particle_size"]["format"] = "range"