From d5a55c3c0232ab296ad7f50be11a4bd578340ff2 Mon Sep 17 00:00:00 2001
From: Andi Gerken <andi.gerken@gmail.com>
Date: Fri, 11 Feb 2022 15:39:52 +0100
Subject: [PATCH] Fixed live version of render

---
 src/robofish/io/file.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/robofish/io/file.py b/src/robofish/io/file.py
index e5bb2b1..0b5c4f1 100644
--- a/src/robofish/io/file.py
+++ b/src/robofish/io/file.py
@@ -906,8 +906,9 @@ class File(h5py.File):
             pbar = tqdm(range(n_frames))
 
         def update(frame):
-            pbar.update(1)
-            pbar.refresh()
+            if "pbar" in locals().keys():
+                pbar.update(1)
+                pbar.refresh()
 
             if frame < n_frames:
                 entity_poses = self.entity_poses_rad
-- 
GitLab