diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-03-14 16:00:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 16:00:02 +0100 |
| commit | fc7adaab7b3856a7831d402ea2bbb27efe7b7d8a (patch) | |
| tree | 23902b836784f4c823d69f200b6aa2c1cffbc9f6 /scene/3d/mesh_instance_3d.cpp | |
| parent | 258ea41ffa00a71bbb6ba9844840f18ba5802816 (diff) | |
| parent | 38c0ad7c6c6b70f1ecac0a7962a60c3105b3d8e8 (diff) | |
Merge pull request #74907 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 3rd batch
Diffstat (limited to 'scene/3d/mesh_instance_3d.cpp')
| -rw-r--r-- | scene/3d/mesh_instance_3d.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 10a7a4e78b..86301ee53f 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -117,8 +117,10 @@ void MeshInstance3D::set_mesh(const Ref<Mesh> &p_mesh) { mesh = p_mesh; if (mesh.is_valid()) { - mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); + // If mesh is a PrimitiveMesh, calling get_rid on it can trigger a changed callback + // so do this before connecting _mesh_changed. set_base(mesh->get_rid()); + mesh->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &MeshInstance3D::_mesh_changed)); _mesh_changed(); } else { blend_shape_tracks.clear(); |