From c31098cad84a844ff1f9f7063b69a7e64823b843 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 12 Feb 2022 14:35:56 +0100 Subject: [PATCH] Check whether the current mesh data instance is still ok, and unset if it gets freed in mdr ed's plugin. This can happen in the editor while messing around with scenes. --- game/addons/mesh_data_resource_editor/plugin.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/game/addons/mesh_data_resource_editor/plugin.gd b/game/addons/mesh_data_resource_editor/plugin.gd index d733834c..ebfa3ac1 100644 --- a/game/addons/mesh_data_resource_editor/plugin.gd +++ b/game/addons/mesh_data_resource_editor/plugin.gd @@ -143,6 +143,9 @@ func get_mdr() -> MeshDataResource: # return false func forward_spatial_gui_input(index, camera, event): + if (!is_instance_valid(current_mesh_data_instance)): + current_mesh_data_instance = null + if current_mesh_data_instance && current_mesh_data_instance.gizmo: if current_mesh_data_instance.gizmo.forward_spatial_gui_input(index, camera, event): return true