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

Imported armature issues #324

Closed
Quinten123 opened this issue Feb 25, 2019 · 5 comments · Fixed by #946
Closed

Imported armature issues #324

Quinten123 opened this issue Feb 25, 2019 · 5 comments · Fixed by #946
Labels
enhancement New feature or request importer This involves or affects the import process Skinning_&_Rigging

Comments

@Quinten123
Copy link

Hummingbird_Gltf.zip

Whenever i import this gltf file the armature comes out weird. Bones are uncorrectly sized, unconnected to the parent, and rotated.
screensht_1
screensht_2

@julienduroure julienduroure added the importer This involves or affects the import process label Feb 26, 2019
@julienduroure
Copy link
Collaborator

I don't think there is any issue here.
"bone" object (with a head and a tail) has no equivalent in glTF (where you can find "joint"). That means that :

  • There is no size stored in glTF, because a joint is ponctual
  • bones are correctly parented, but there is no notion of connection between joints (except parent / child relationship that are OK in your example file)
  • rotation seems to be legit regarding data that are glTF file
  • animation seems to be OK

I will set this issue as "enhancement", because we probably could fake some rotation on created bones to have them visually better aligned.

@julienduroure julienduroure added the enhancement New feature or request label Feb 26, 2019
@Quinten123
Copy link
Author

Thank you, I do hope it will it will be improved, so it's easier to see the structure of the bones and work with them more easily. Right now it's a bit difficult. If you need more gltf files like this i have a bunch more.

@scurest
Copy link
Contributor

scurest commented Mar 5, 2019

Bones are rotated and sized plausibly in gltf-blender-importer. At least non-leaf bones

hum

Basically, we pick a rotation cr(b) for each bone b, and the local-to-parent T(b) for that bone is replaced with T'(b) = cr(pb)^{-1} T(b) cr(b) where pb is the parent of b. Then when you compose with the parent, T'(pb) T'(b), the cr(pb)^{-1} at the left of T'(b) is cancelled out by the cr(pb) on the right of T'(pb), and so on up the tree, so it doesn't end up affecting the end result of skinning. Then you just need to pick a cr(b) that will look good.

You have to maintain the relation between T'(b) and T(b) when you animate pose bones too.

This is probably the most annoyingly complicated thing in that importer, but see this comment about picking the edit bones and this comment about picking the pose bones during animation.

@Quinten123
Copy link
Author

Thank you so much! I have tried the importer and everything works fine, even the animations! Now i can work with it alot easier.

Kind regards,

Quinten

@julienduroure
Copy link
Collaborator

@scurest & @Quinten123

Thanks for pointing me to that algo.
I was thinking about something like that. I will implement it inside this official addon

Julien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request importer This involves or affects the import process Skinning_&_Rigging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants