From aedbd874803ced142e2963f9e9bfa1e15e59071d Mon Sep 17 00:00:00 2001 From: Brosef Date: Thu, 4 Jun 2026 17:26:06 +0100 Subject: [PATCH] Fixed #3 --- camera.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/camera.py b/camera.py index 12ab438..e8d5e73 100644 --- a/camera.py +++ b/camera.py @@ -188,13 +188,20 @@ class Camera: # Wait until the camera is ready self._waitForCameraReady() time.sleep(0.75) + # Check the camera mode, and see if it's disabled + if self._lastMode == 0: + # If so, break out of the loop. + print('Camera disabled. Bailing out.') + break # Take a new picture self.oscClient.send_message('/usercamera/Capture', True) # Reset the lastPicture time, the set that happens at the start of this # function is not fast enough and causes race conditions. self.lastPicture = time.perf_counter() # Wait for the camera to be ready one last time to prevent a cycle - self._waitForCameraReady() + # but only if the camera is still enabled. + if self._lastMode != 0: + self._waitForCameraReady() except TimeoutError: print('WARNING: Timeout occured during multishot. Bailing out.')