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

FBX Loader: Displaced Animation Playback #14864

Closed
liz3 opened this issue Sep 6, 2018 · 12 comments
Closed

FBX Loader: Displaced Animation Playback #14864

liz3 opened this issue Sep 6, 2018 · 12 comments
Labels

Comments

@liz3
Copy link

liz3 commented Sep 6, 2018

Hello, im pretty new to three.js but getting into it was pretty easy with the quite extensive collection of examples.
Though i encountered a for me game breaking "bug"(In Quotes because it could be related to a wrongly exported file).

I am using the FBX Example to display a FBX Model with a animation. But the animation is been displayed completely wrong.
After i noticed that, i loaded the in the example provided "Dancing Samba", this model worked without any issues.

So the issue has to be related with the (from Maya 2018) exported file.
I noticed that the "FBX binary version" of the example model is 7400 and my file was 7500, i then exported the file again with the 2014 fbx version, the displayed version changed to 7400, the bug is still there though.

I included both the 7500 and 7400 version of the file and a short mp4 video showing the working state first and then the non working, in the zip.
Files.zip
Implementation Code

Info:
Browser: Chrome 68.0.3440.106
Three.js Version: (npm, bundled with webpack and babel): three-full 11.0.1
System: I7 8700K, GTX 1060

Regards,
Yann HN(Liz3)

@looeee
Copy link
Collaborator

looeee commented Sep 6, 2018

Thanks for the thorough bug report. I suspect it's because the way transforms are implemented in Maya are quite different than in 3DS Max, and I've been concentrating on that while creating the animation system. I'll have to look into this a bit more and see if I can update the code to better support Maya transforms.

Can you try exporting with the "bake animations" setting turned on and see if it works better with that?

In the meantime as a workaround you could also try converting to glTF format using FBX2glTF. It's a command tool, and there are prebuilt binaries here

@liz3
Copy link
Author

liz3 commented Sep 6, 2018

@looeee Though i havent get the gltf thing to work, if have some interesting fact:
I just imported the .fbx into blender and exported it again(with default settings), that for some reason fixed the issue....so my theory that its related to export options is true, though by now i almost tried every possible setting, none worked until now.
I will comment if i find a option that fixes it.

@looeee
Copy link
Collaborator

looeee commented Sep 6, 2018

I just imported the .fbx into blender and exported it again(with default settings), that for some reason fixed the issue....

Blender uses the same transform as 3DS Max (at least when exporting FBX files).

so my theory that its related to export options is true

Possibly, but I would say my theory that it's related to the difference in how transforms are applied in Maya is more likely. Nonetheless, can you confirm that the issue is still there when exporting with "bake animations" on?

@liz3
Copy link
Author

liz3 commented Sep 6, 2018

@looeee yes it doesnt change anything.
Also when converting the fbx into glFT it still doesnt change anything.

Blender uses the same transform as 3DS Max (at least when exporting FBX files).

Makes sense

@donmccurdy
Copy link
Collaborator

You may also want to try the Maya glTF exporter (https://github.com/WonderMediaProductions/Maya2glTF). I know the author is doing some particular workarounds for skinning there (donmccurdy/three-gltf-viewer#101).

If that doesn't work, do you mind if I upload your sample files to open bug reports on FBX2glTF and Maya2glTF?

@liz3
Copy link
Author

liz3 commented Sep 11, 2018

Il try it and yes you can use these files, il comment again when i tested

@donmccurdy
Copy link
Collaborator

Actually FBX2glTF is working correctly, as far as I can tell. The animation in FBX Review looks the same as playing on https://gltf-viewer.donmccurdy.com/

050faf1d-ebc3-4061-af1b-7fda2e1ace2f-59407-0002d687a79a9ea2

Is it not working for you? Note from the docs that GLTFLoader returns a differently-structured result than FBXLoader.

@liz3
Copy link
Author

liz3 commented Sep 15, 2018

@donmccurdy which arguments did you used in the convertion process and could you share the exact source of the threejs player playing the animation?

@liz3
Copy link
Author

liz3 commented Sep 15, 2018

Note For all: The (for now) Workarround is to just export the fbx from maya, import it in Blender and re export it(no specific changes required)

@donmccurdy
Copy link
Collaborator

The conversion is just FBX2glTF -i input.fbx -o output, and the viewer's full code is here but a simpler snippet for loading a model and playing animation would be this: https://github.com/mrdoob/three.js/blob/dev/examples/webgl_postprocessing_unreal_bloom.html#L118-L135.

@chinazaaa
Copy link

Please do i load two different fbx files with animation in Javascript

@donmccurdy
Copy link
Collaborator

@chinazaaa please use the forums (http://discourse.threejs.org/) or Stack Overflow for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants