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 animation, weird out of plane rotation when leaving origin. #12398

Closed
1 of 9 tasks
FuzzyWobble opened this issue Oct 12, 2017 · 17 comments
Closed
1 of 9 tasks

Comments

@FuzzyWobble
Copy link

When animation leaves the origin, some wacky rotation stuff going on causing animation to be slightly out of plane. Only happens when animation leaves origin -_-
demo -> https://fuzzy.cc/ar_new/testfbx/player.html
Perfectly in plane when I load the FBX file into Blender.
@takahirox
Thanks x1000

Three.js version
  • [ x] Dev
  • r87
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • [] All of them
  • Windows
  • [x ] macOS
  • Linux
  • Android
  • [ x] iOS
@looeee
Copy link
Collaborator

looeee commented Oct 13, 2017

Can you test with the latest version of the loader from the dev branch?

This might be fixed by #11963

@FuzzyWobble
Copy link
Author

@looeee wow it was worth a shot (that FBXLoader was updated 1hr ago!). sadly, no luck. still the same -> https://fuzzy.cc/ar_new/testfbx/player.html

@looeee
Copy link
Collaborator

looeee commented Oct 13, 2017

@FuzzyWobble oh well, it was worth a shot.

There are a few problems like this with skeleton animations in the FBXLoader. But fixing them is not simple and I haven't had the time to look into it properly yet. Next time I have a spare week though... 😆

@FuzzyWobble
Copy link
Author

@looeee do you think maybe it is just something basic with orientation/origin? (maybe not related to FBXLoader?)

@looeee
Copy link
Collaborator

looeee commented Oct 13, 2017

Perhaps, but then why does the animation work correctly when loading in other apps?

@FuzzyWobble
Copy link
Author

^ tru
@looeee let me know if there is anything to do to help. Sadly, I don't quite have the skills to rewrite the FBXLoader like you guys. But anything I can do to help let me know :) For now, I guess I will try json or gltf.

@looeee
Copy link
Collaborator

looeee commented Oct 15, 2017

@FuzzyWobble the biggest issue that I have in investigating this is that I only have complex model for testing. It's hard to track down the bug with a full human skeleton. If you could try and make a much simpler model (say just one or two joints with bones) that exhibits the problem that would be a great help.

@FuzzyWobble
Copy link
Author

spent a good 10 hours trying stuff. still no luck :(
however, discovered that the problem ONLY shows up when the dancers spin to the left or right (around the Y axis in three.js?). until they spin, everything is working fine!
@looeee does that give you any clues?

@looeee
Copy link
Collaborator

looeee commented Oct 24, 2017

@FuzzyWobble unfortunately not. I've tested this with other fixes I'm working on, but they don't make any difference.

I'll keep your model in my list of test models and update you if I find the issue.

By the way it looks to me like the issue is that the model is having some extra z-rotation added (the axis that goes into the screen).

@FuzzyWobble
Copy link
Author

@looeee my friend Jorge @MechanicalHuman dug into it a bit. he is 100x better at three.js than me.

He got this going: https://d26dzxoao6i3hh.cloudfront.net/items/2w0L3V2P2q1m2E3a0U3Y/Screen%20Recording%202017-10-25%20at%2002.26%20AM.gif
Which seem to show that the hip bone of the body is NOT rotating properly.

He also noted this warning: “More than 4 bones affecting the same vertex/ the rest will be ignored” might be a dealbreaker.

The other thing is weird is that the hip bone should be 0 - 3 on the track array as the transformations will apply in the array order but is 6-9.

Any clues here? He was able to load into Maya fine. And I am able to load into Blender fine. But no luck with three.js FBXLoader.

Thanks!!!

@MechanicalHuman
Copy link

@looeee, super noob question. If I capture the output of the FBXloader as a JSON file, will it be valid THREE.json?

@FuzzyWobble Did you edited the FBX file post-capture in any way? The track is named FuzzyWouble, so I imagine yes, can I get the original capture?

@looeee
Copy link
Collaborator

looeee commented Oct 26, 2017

@FuzzyWobble It could be the bones limit - I plan to investigate the algorithm that is used to remove excess bones at some point and see if I can improve it. However all models from Mixamo display this warning and many are fine so it might not be that.

@MechanicalHuman if you use the .toJSON() function of the Group that is output from the the FBXLoader then it should be, although I don't know how perfect serialization of skeleton data is.
BTW you can use my loader here and export as JSON to do this quickly.

@looeee
Copy link
Collaborator

looeee commented Oct 27, 2017

@FuzzyWobble @MechanicalHuman I may have found the problem - on this line:

worldMatrices.set( parseInt( node.id ), rawMatWrd );

node.id is undefined, for quite a few models that I've tested, but only if they are in Binary format (if I export the same model in ASCII format the id is there).

So this is probably an issue with the BinaryParser.

I won't have time to look into this for the next couple of days, but I'll try and find a fix early next week.

@FuzzyWobble
Copy link
Author

@looeee bravo u genus!
@takahirox may have a quick fix?
Yeah, using binary would be much slicker than ascii for my implementation.

@looeee thanks so much for looking into this! Getting close I feel...

@looeee
Copy link
Collaborator

looeee commented Oct 28, 2017

@FuzzyWobble just to confirm that this is the issue, would you be able to test your model in ASCII format?

@looeee
Copy link
Collaborator

looeee commented Nov 20, 2017

@FuzzyWobble still no progress with this unfortunately - however after recent updates to the loader, importing into 3DS Max and then re-exporting does work at least

fuzzywobble_reexport.zip

@looeee
Copy link
Collaborator

looeee commented Nov 27, 2017

@FuzzyWobble fixed by #12758 😁

@looeee looeee closed this as completed Dec 8, 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

No branches or pull requests

3 participants