Repository: three.js
Issue: FBXLoader not working with many skeleton animations (e.g., from Mixamo.com)
Labels: Bug,Loaders

##### Description of the problem

The FBXLoader does not work with many skeleton animations. e.g., from Mixamo.com. One example from Mixamo that fails is the following:

   Character: WHITECLOWN N HALLIN
   Animation: SAMBA DANCING

You can get this model by downloading it from Mixamo directly but I have also attached it to this issue.
[WhiteClownSambaDancing.zip](https://github.com/mrdoob/three.js/files/2375109/WhiteClownSambaDancing.zip)

Here is the displayed result using the webgl_loader_fbx.html sample in THREE v96 modified to load the WhiteClownSamaDancing.fbx:

![whiteclownsambadancing_fbxloader](https://user-images.githubusercontent.com/9258904/45424827-4c1d4300-b65d-11e8-89ff-e599e2887b26.png)
_Screen shot using webgl_loader_fbx.html_


Here is the same FBX file displayed in AutoDesk FBX Review:
![whiteclownsambadancing_fbxreview](https://user-images.githubusercontent.com/9258904/45425263-71f71780-b65e-11e8-8256-11a798ecefef.png)
_Screen shot using AutoDesk FBX Review_

There are many other Mixamo character/animations pairings that work fine with the FBXLoader but many that do not. It is possible (though not confirmed) that the ones that fail were created with Maya (this has been stated as a possible problem in some other issues).

Also, the WhiteClownSambaDancing.fbx file loads correctly in many other software including the Mixamo site itself and [http://www.open3mod.com/](http://www.open3mod.com/). The later is fully open source so you can see the exact code they use to perform the node/bone transforms and animations. They actually use AssImp for their conversion and you can see the exact code there. In particular, see the following for their FBX import 3D transform handling:

[https://github.com/assimp/assimp/blob/master/code/FBXConverter.cpp#L644](https://github.com/assimp/assimp/blob/master/code/FBXConverter.cpp#L644)

After digging into the FBXLoader code a bit, it seems there may be several areas where the issue could lie:

- There does not seem to be any code to honor the FBX inherit type on the nodes.
- There does not seem to be any code to implement rotate/scale pivot points on the nodes (NOT the geometry transforms which are implemented).

The following code from the AutoDesk FBX SDK may be of some help for implementing both of the above, esp. the code and comments in CalculateGlobalTransform():

[AutoDesk FBX source code Transformations/main.cxx](http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/index.html?url=cpp_ref/_transformations_2main_8cxx-example.html,topicNumber=cpp_ref__transformations_2main_8cxx_example_htmlfc10a1e1-b18d-4e72-9dc0-70d0f1959f5e)

There are some other THREE.js issues which have not been fully addressed regarding incorrect FBX animations loaded via the FBXLoader (#11895, #13466, #13821). This issue is about improving the FBXLoader, not a particular file or asset pipeline. Please do not suggest use of FBX2GLTF (which just bakes the animations) or other converters.

Also, we are willing to provide some help with design and coding, if need be, but doing a full solution with a PR is beyond our bandwidth at this time (ping @looeee @Kyle-Larson @takahirox ?).

##### Three.js version

- [ ] Dev
- [X] r96
- [ ] ...

##### Browser

- [x] All of them
- [ ] Chrome
- [ ] Firefox
- [ ] Internet Explorer

##### OS

- [x] All of them
- [ ] Windows
- [ ] macOS
- [ ] Linux
- [ ] Android
- [ ] iOS

##### Hardware Requirements (graphics card, VR Device, ...)