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

Conversation

pouleyKetchoupp
Copy link
Contributor

This fixes a regression from PR #40313 (support for software skinning in MeshInstance).

Before, the base mesh was always updated on load even if not skinning was used, which caused mesh instance materials to be reset on the rendering side.

Now the base mesh is set only when it has been modified (to avoid unnecessary updates on the render side), or when switching software skinning on or off. In this case the mesh instance materials are always updated properly afterwards.

Fixes #42675

CC @lawnjelly
Thanks for tracking the issue down! In the end I've chosen not to disable the whole call to initialize skinning as you suggested in #40313 (comment) because I want to make sure skinning is properly reset if needed when the skeleton path is changed.
Since the cause is calling set_base without updating materials afterwards it should be fine now.

This fixes a regression from PR godotengine#40313 (support for software skinning in MeshInstance).

Before, the base mesh was always updated on load even if not skinning
was used, which caused mesh instance materials to be reset on the
rendering side.

Now the base mesh is set only when it has been modified, or when
switching software skinning on or off. In this case the mesh instance
materials are always updated properly afterwards.
@pouleyKetchoupp pouleyKetchoupp added this to the 3.2 milestone Oct 16, 2020
@akien-mga akien-mga merged commit 2dc8ed2 into godotengine:3.2 Oct 16, 2020
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp
Copy link
Contributor Author

This PR also addresses regressions with blend shapes: #42767 & #42768 by avoiding unnecessary calls to re-initialize the mesh on the render side.
Note that it doesn't fix the potential underlying issue about blend shapes mentioned in #37854.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants