Merge pull request #97770 from tdaven/fix-94151
Fix immediate mesh modifications that don't call set_mesh
This commit is contained in:
commit
3fcbb1d436
2 changed files with 15 additions and 0 deletions
|
@ -54,7 +54,20 @@ void MeshInstance2D::_bind_methods() {
|
|||
}
|
||||
|
||||
void MeshInstance2D::set_mesh(const Ref<Mesh> &p_mesh) {
|
||||
if (mesh == p_mesh) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mesh.is_valid()) {
|
||||
mesh->disconnect_changed(callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
|
||||
}
|
||||
|
||||
mesh = p_mesh;
|
||||
|
||||
if (mesh.is_valid()) {
|
||||
mesh->connect_changed(callable_mp((CanvasItem *)this, &CanvasItem::queue_redraw));
|
||||
}
|
||||
|
||||
queue_redraw();
|
||||
}
|
||||
|
||||
|
|
|
@ -312,6 +312,8 @@ void ImmediateMesh::surface_end() {
|
|||
uses_uv2s = false;
|
||||
|
||||
surface_active = false;
|
||||
|
||||
emit_changed();
|
||||
}
|
||||
|
||||
void ImmediateMesh::clear_surfaces() {
|
||||
|
|
Loading…
Reference in a new issue