Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mesh instance materials not initialized correctly #42846

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scene/3d/mesh_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
set_base(render_mesh);
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) {
Expand Down