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

Support FBX Binary format #11325

Merged
merged 3 commits into from
May 13, 2017
Merged

Support FBX Binary format #11325

merged 3 commits into from
May 13, 2017

Conversation

takahirox
Copy link
Collaborator

@takahirox takahirox commented May 13, 2017

This PR lets FBXLoader2 support FBX Binary format. #9860

Binary model data can include compressed data.
You need to import examples/libs/zlib_and_gzip.min.js for such models.

BTW does anyone have good FBX Binary model data which can be used as an example?

@mrdoob mrdoob merged commit 0e1dce6 into mrdoob:dev May 13, 2017
@mrdoob
Copy link
Owner

mrdoob commented May 13, 2017

Many thankss!

@takahirox takahirox deleted the FBXBinaryParser branch May 13, 2017 21:55
@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

Hmm, any chance this could depend on http://stuk.github.io/jszip/ instead? That's what https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/KMZLoader.js and https://threejs.org/editor/ depends on already.

@takahirox
Copy link
Collaborator Author

OK, I'll try.

(BTW who uses examples/libs/zlib_and_gzip.min.js?)

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

NRRDLoader.js it seems...

@takahirox
Copy link
Collaborator Author

takahirox commented May 14, 2017

Hm, it seems JSZip's APIs aren't fitting to FBXLoader.
FBXLoader just needs raw inflate(uncompress) function but
JSZip APIs expect zip (archived+compressed) file/data.

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

So then it mainly needs https://github.com/imaya/zlib.js/blob/master/bin/rawinflate.min.js, right?

What do you think about adding that code directly inside FBXLoader so it just works?

@takahirox
Copy link
Collaborator Author

I can try, but personally I think I want to separate them for maintenance.
(Maybe dev's ease of maintenance vs user's ease of use)

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

Oks! Sounds good 👌

@mrdoob
Copy link
Owner

mrdoob commented May 14, 2017

Some clean up... NRRDLoader only needed gunzip, so I replaced zlib_and_gzip.min.js with gunzip.min.js. We already had inflate.min.js in the libs so we can use that for FBXLoader.

@vinaysshenoy
Copy link

vinaysshenoy commented May 15, 2017

The loader doesn't seem to handling certain FBX files properly. I've attached an FBX file which I'm using to test it, and the model imports correctly in Unity3D, but the geometry doesn't load properly in the FbxLoader. Attaching screenshots for reference.

screen shot 2017-05-15 at 2 09 12 pm

screen shot 2017-05-15 at 2 08 41 pm

screen shot 2017-05-15 at 2 08 30 pm

screen shot 2017-05-15 at 2 14 37 pm

Here's the FBX file

@takahirox Would you be able to take a look at this?

Note: The file unit is 1 unit = 1 mm, so you might want to adjust the camera far plane so you can see the entire object.

@takahirox
Copy link
Collaborator Author

Would you please check if text version of that model can be displayed correctly with FBXLoader?
I'd like to clarify if this issue is of binary parser.

@vinaysshenoy
Copy link

@takahirox I just checked. ASCII version is also not displaying correctly.

I suppose this is actually related to the Fbx -> THREE.Group conversion not handling certain cases.

@takahirox
Copy link
Collaborator Author

I see.
Would you please make another issue?
This thread already has been merged/closed.

@vinaysshenoy
Copy link

Sure, will do.

amakaroff82 pushed a commit to amakaroff82/three.js that referenced this pull request May 30, 2017
amakaroff82 pushed a commit to amakaroff82/three.js that referenced this pull request May 30, 2017
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.

None yet

3 participants