From 47f75547ce976988fd067c66ae6345d57771616b Mon Sep 17 00:00:00 2001 From: Trevor Davenport Date: Thu, 3 Oct 2024 08:14:19 -0600 Subject: Fix immediate mesh modifications that don't call set_mesh Mesh_instance_2d has no way to know when the mesh had been modified unless you called set_mesh. This meant that you could modify the underlying mesh without it knowing which could result in incorrect result. Modified mesh_instance_2d to be more similar to mesh_instance_3d which connects to the changed signal of the mesh and reacts occordingly. --- scene/resources/immediate_mesh.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/resources/immediate_mesh.cpp') diff --git a/scene/resources/immediate_mesh.cpp b/scene/resources/immediate_mesh.cpp index 907c0ab4ca..072542f0ad 100644 --- a/scene/resources/immediate_mesh.cpp +++ b/scene/resources/immediate_mesh.cpp @@ -312,6 +312,8 @@ void ImmediateMesh::surface_end() { uses_uv2s = false; surface_active = false; + + emit_changed(); } void ImmediateMesh::clear_surfaces() { -- cgit v1.2.3