From c01afebc0aa38df8485c7fffabaa21ab83e96f50 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Fri, 19 Apr 2024 18:41:38 +0200 Subject: [PATCH] fix load_file so cancel does not break reload also is_filedialog_open guard was not needed --- ogre_mesh_viewer.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ogre_mesh_viewer.py b/ogre_mesh_viewer.py index c991952..09eeb90 100755 --- a/ogre_mesh_viewer.py +++ b/ogre_mesh_viewer.py @@ -138,7 +138,6 @@ def __init__(self, app): self.show_metrics = False self.show_render_settings = False self.side_panel_visible = True - self.is_filedialog_open = False self.app = app @@ -202,12 +201,11 @@ def draw_loading(self): ImGui.End() def load_file(self): - # Avoid recursive calling, which might block the window manager - if self.is_filedialog_open: + infile = askopenfilename(app.filedir) + if not infile: return - self.is_filedialog_open = True - app.infile = askopenfilename(app.filedir) - self.is_filedialog_open = False + + app.infile = infile app.reload() def preRenderTargetUpdate(self, evt):