From f9543cdae6dcfbede5a493da6cbde2223b94b541 Mon Sep 17 00:00:00 2001 From: mrkickling Date: Fri, 13 Mar 2026 13:50:23 +0100 Subject: [PATCH] fix: make sure scene is reloaded when model is loaded --- mal_gui/main_window.py | 6 ++++-- mal_gui/model_scene.py | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mal_gui/main_window.py b/mal_gui/main_window.py index d39fbc6..51e70e4 100644 --- a/mal_gui/main_window.py +++ b/mal_gui/main_window.py @@ -583,10 +583,12 @@ def load_scenario(self, file_path: str): def load_model(self, file_path: str): """Load a MAL model from a file""" - self.model_file_name = file_path - self.scene.model = Model.load_from_file( + model = Model.load_from_file( file_path, self.scene.lang_graph ) + self.load_scene(self.lang_file_path, model, None) + self.scenario_file_name = None + self.model_file_name = file_path def add_positions_to_model(self): """Add x/y positions to asset extras of model""" diff --git a/mal_gui/model_scene.py b/mal_gui/model_scene.py index a20a060..f762750 100644 --- a/mal_gui/model_scene.py +++ b/mal_gui/model_scene.py @@ -476,7 +476,6 @@ def draw_model(self): assets_without_position = [] x_max = 0 y_max = 0 - for asset in self.model.assets.values(): if 'position' in asset.extras: