Merge pull request #42846 from nekomatata/mesh-material-regression-fix

Fix mesh instance materials not initialized correctly
This commit is contained in:
Rémi Verschelde 2020-10-16 10:53:19 +02:00 committed by GitHub
commit 2dc8ed2925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -355,9 +355,9 @@ void MeshInstance::_initialize_skinning(bool p_force_reset) {
}
RID render_mesh = software_skinning ? software_skinning->mesh_instance->get_rid() : mesh->get_rid();
if (update_mesh || (render_mesh != get_base())) {
set_base(render_mesh);
if (update_mesh) {
// Update instance materials after switching mesh.
int surface_count = mesh->get_surface_count();
for (int surface_index = 0; surface_index < surface_count; ++surface_index) {