-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
FBXLoader: Check null textures before assignment #22114
Conversation
This looks good, thanks! 👍 |
I've updated this some more to not assign the |
Without this, the imported material has map defined but map.image undefined - this causes issues with GLTFExporter (and perhaps others) which checks for map !== undefined and then uses map.image. Would you prefer I reversed this commit and changed GLTFExporter to check for this instead? |
No, it's better to fix this in Thanks for the additional explanation. Wouldn't it be better if Besides, |
It is valid actually: Maybe we can start adopting it? |
But yes, adding the logic to |
Interesting! Support looks sufficiently good. |
FBXLoader: Check null textures before assignment Use !== FBXLoader: don't assign maps if images are missing
Thanks for the feedback. I've updated this to return undefined from |
Clean up code style.
Cleaned up the code style a bit... |
Thanks! |
Description
We've found that a variety of FBX exporters from CAD software fail to correctly create/assign textures. As a result,
scope.getTexture
returns null/undefined, but the code fails when attempting to assign an encoding or other property immediately after.As such, the preferred behaviour would be to load what is possible from the model (sans textures if they are not able to load) rather than throw and exception.