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

FBXLoader: Handle invalid material indices. #24436

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Aug 3, 2022

Fixed #24357.

Description

It seems there are exporters like the one from Cinema4D which might export FBX assets with negative material indices. I have found no official documentation about valid values of the FBX field LayerElementMaterial.Materials.a. However, negative values are not supported in three.js.

The loader now reports a warning when negative material indices are detected and uses 0 instead.

Just want to note that an asset with missing material definitions is a model authoring error and should be fixed in a DCC tool.

@Mugen87 Mugen87 added this to the r144 milestone Aug 3, 2022
@Mugen87 Mugen87 merged commit 88c240d into mrdoob:dev Aug 3, 2022
@mrdoob
Copy link
Owner

mrdoob commented Aug 3, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
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.

FBXLoader: Invalid material indices break raycasting.
2 participants