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.js bug and resolvement in v119 #19967

Closed
jimver04 opened this issue Jul 30, 2020 · 9 comments
Closed

FBXLoader.js bug and resolvement in v119 #19967

jimver04 opened this issue Jul 30, 2020 · 9 comments

Comments

@jimver04
Copy link

examples/js/loaders/FBXLoader.js L3554

var inflate = new Inflate( new Uint8Array( reader.getArrayBuffer( compressedLength ) ) );
->
var inflate = new Zlib.Inflate( new Uint8Array( reader.getArrayBuffer( compressedLength ) ) );

Otherwise Inflate can not be found.
jimver

@jimver04 jimver04 changed the title FBXLoader.js bug in v119 FBXLoader.js bug and resolvement in v119 Jul 30, 2020
@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 30, 2020

Possibly introduced with #19748.

/cc @sciecode

@sciecode
Copy link
Contributor

Thank you for pinging @Mugen87 and thank you for bringing attention to this @jimver04.

I had tested the behavior of FBX and all of the other loaders involved in that PR, everything appeared normal. But it is possible I've missed something. I'll run a few tests to determine if we should revert those changes.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 30, 2020

@jimver04 Any chances to share your FBX file in this thread for testing?

@jimver04
Copy link
Author

Send me your email: jimver04 at gmail.com

@jimver04
Copy link
Author

Perhaps it is because I am using "Three.js" but not "Three.module.js" ???

@jimver04
Copy link
Author

jimver04 commented Jul 30, 2020

fbx Exported as binary from Blender 2.83.2 but some parts of it are not mine and I can not share in the thread. I can send you via email : jimver04 at gmail.com

@sciecode
Copy link
Contributor

Perhaps it is because I am using "Three.js" but not "Three.module.js" ???

It is a possibility, even though I remember testing the non-modular variant as well.

I have reached you through email, you may remove your contact info if you wish to avoid spams and unwanted emails.

@sciecode
Copy link
Contributor

sciecode commented Jul 31, 2020

I wasn't able to reproduce any problems on FBX/VTK/EXR loaders with either the modular or non-modular variants of the inflate/deflate libs. However I have an idea as to what could be your problem.

FBXLoader specifically displays a warning when failing to locate the Inflate.js library:

THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js

However, since #19748, our inflate API has changed. Using the links lib version will no longer work properly. You must use three.js dev distribution version inflate.min.js.

I believe this might solve your issue, but we could perhaps update these warnings in both FBX and EXR loaders just in case.

( or study different alternatives as discussed on the PR )

@jimver04
Copy link
Author

jimver04 commented Aug 1, 2020

Sciecode I didn't find your email but you have right:

I downloaded inflate.min.js from https://github.com/imaya/zlib.js/bin/
as prompted by the warning which actually led me to wrong version of Inflate

However, the version inside Three.js is the one that works with both "new Inflate" (also works with new Zlib.Inflate)
It has an extra line in the end: var Inflate = Zlib.Inflate; which makes both classes equal, no idea why.

So to conclude and close the issue:

The warning at FBXLoader.js ~L3550 should be replaced as follows

THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js

->
THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/mrdoob/three.js/blob/dev/examples/js/libs/inflate.min.js

or make the change at FBXLoader.js L3554 , i.e. replace Inflate with Zlib.Inflate
and also remove the last line from Inflate.min.js (of Three.js) namely "var Inflate = Zlib.Inflate;"

@jimver04 jimver04 closed this as completed Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants