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.

This commit is contained in:
Relintai 2022-02-12 14:35:56 +01:00
parent 19f4e9216e
commit c31098cad8

View File

@ -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