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

fixed TMPro export with multiple font weights (invalid texture hash) #744

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Vaso64
Copy link

@Vaso64 Vaso64 commented Jun 27, 2024

I had trouble exporting objects with TMPro text, containing multiple font weights (bold, italic etc.)
The UnityGLTF correctly exports all font atlas materials, but their textures are all the same.
After closer inspection, it seems that these textures do not have a valid Texture.imageContentsHash, which leads to exporter to just re-use the previously cached atlas texture, even if they are different.
I made it so in case of !Texture.imageContentsHash.isValid, the UniqueTexture.GetHashCode() fallbacks to using Texture.GetHashCode().

Example:
fix_demo

@CLAassistant
Copy link

CLAassistant commented Jun 27, 2024

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

2 participants