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: Account for invalid parseAnimationLayers children IDs #19368

Merged
merged 3 commits into from
May 15, 2020
Merged

FBXLoader: Account for invalid parseAnimationLayers children IDs #19368

merged 3 commits into from
May 15, 2020

Conversation

jake
Copy link
Contributor

@jake jake commented May 15, 2020

For some of my FBX files, a few of the relationships point to objects without any relationship data. As a result, parseAnimationLayers crashes when accessing fbxTree.Objects.Model[ modelID.toString() ] and the FBX fails to parse.

Here are a few sample FBX that fail to parse as a result of the invalid data. The files were generated with Unity's FBX Exporter plugin, but are valid in every other FBX viewer or importer I have.

https://hypermesh-staging.accelerator.net/dev/performances/eeh5Y6?download=BNN-E021-A007.fbx (63MB)

Screen Shot 2020-05-15 at 4 35 26 PM

https://hypermesh-staging.accelerator.net/dev/performances/XdhjOd?download=BNN-E021-A010.fbx (28MB)

Screen Shot 2020-05-15 at 4 37 06 PM

Let me know if I can be of any help testing, or providing more detail. This goes more low-level than I'm familiar with, so I'm not sure if the bug is better fixed on a helper level. I've also left debugging log in there, as I figured it helps highlight the problem.

jake and others added 2 commits May 14, 2020 16:36
seems to be connections with null relationships
@mrdoob mrdoob added this to the r117 milestone May 15, 2020
@@ -2491,6 +2491,11 @@ THREE.FBXLoader = ( function () {
if ( modelID !== undefined ) {

var rawModel = fbxTree.Objects.Model[ modelID.toString() ];

if (!rawModel) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the code more readable:

if ( rawModel === undefined ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated!

@mrdoob mrdoob merged commit 7d4292c into mrdoob:dev May 15, 2020
@mrdoob mrdoob changed the title Account for invalid parseAnimationLayers children IDs in FBXLoader FBXLoader: Account for invalid parseAnimationLayers children IDs May 15, 2020
@mrdoob
Copy link
Owner

mrdoob commented May 15, 2020

Thanks!

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