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

"Generate physical skeleton" creates wrong bone positions #53466

Closed
Tracked by #45333
MrMinimal opened this issue Oct 6, 2021 · 9 comments
Closed
Tracked by #45333

"Generate physical skeleton" creates wrong bone positions #53466

MrMinimal opened this issue Oct 6, 2021 · 9 comments

Comments

@MrMinimal
Copy link
Contributor

MrMinimal commented Oct 6, 2021

Godot version

3.3.4.stable.official

System information

Windows 10

Issue description

I have a detailed asset, which I wanted to contribute to the Asset Store.
It has a weight painted armature/rig, which I wanted to import into Godot.

Using GLTF, the model has a skeleton, in which all bones have their correct position.
When generating the physical skeleton though, the resulting physical bones are all out of place.

Blender 2.93
grafik

Godot 3.3.4.stable.official
grafik

Steps to reproduce

  1. Open the project - the default scene contains the offset bones.

To recreate yourself with this project

  1. Open Blender file
  2. Export to gltf
  3. Open gltf file in Godot
  4. Select Skeleton from hierarchy
  5. Press Button "Skeleton"
  6. Select "Create physical skeleton"
  7. Hide "mira" mesh in hirarchy to see the skeleton and the generated bones

To recreate yourself from scratch:

  1. Open Blender
  2. Add->Armature->Human(Meta-Rig)
  3. Add->Mesh->Cube
  4. Select Armature, select cube
  5. Ctrl+P, select "With automatic weights"
  6. Export to GLTF
  7. Open in Godot
  8. Select Skeleton from hierarchy
  9. Press Button "Skeleton"
  10. Select "Create physical skeleton"
  11. Hide "cube" mesh in hirarchy to see the skeleton and the generated bones

Minimal reproduction project

Project (sorry, bigger than 100 MB):
https://drive.google.com/file/d/1hL__pWpMKldgO745Uzs5g78lT5TlNctn/view?usp=sharing

@MrMinimal
Copy link
Contributor Author

My guess is, the axis which is used to offset the physical bone from the skeleton bone origin is wrong.
Should be the bone's local Z axis, not its local Y axis.
https://user-images.githubusercontent.com/8739690/136189585-7e22d5a9-d064-4f54-b1eb-27018444c604.mp4

@rcorre
Copy link
Contributor

rcorre commented Jan 21, 2022

Here's a more minimal example
1642769177
example.zip

Here, "Create Physical Skeleton" did not create bones for LowerLeg.L/LowerLeg.R at all (those bones can be selected from the PhysicalBone dropdown though).

@Calinou
Copy link
Member

Calinou commented Jan 21, 2022

I can confirm this on 3.x 3e7e701:

image

@rcorre Could you test #53515 locally to see if it resolves this issue?

@rcorre
Copy link
Contributor

rcorre commented Jan 21, 2022

BTW, just realized the lower legs didn't generate because the upper legs were not parented to the hip bone. That might be a bug, but normally I wouldn't have more than 1 parent-less bone, so it might not be a big deal. After fixing that:

1642769969

@rcorre
Copy link
Contributor

rcorre commented Jan 21, 2022

With #53515, the generated bones are now positioned correctly, however it still skips the lower/upper arms (even after fixing the parenting in blender):

1642771158

That seems like an unrelated issue so I'll open a separate ticket.

@tavurth
Copy link
Contributor

tavurth commented Mar 29, 2022

This seems to be related to this PR which was merged to master 2 years ago but maybe never got backported:

#36008

@rcorre
Copy link
Contributor

rcorre commented Mar 30, 2022

The bones are generated in the correct positions on main for the example I posted, so #36008 may have fixed it.

@tavurth
Copy link
Contributor

tavurth commented Mar 30, 2022

The bones are generated in the correct positions on main

Yep a backport of #36008 will fix this issue, if you'd like to take it first feel free!

@akien-mga akien-mga modified the milestones: 3.5, 3.x Jul 2, 2022
@akien-mga akien-mga modified the milestones: 3.x, 3.5 Dec 12, 2022
@akien-mga
Copy link
Member

Fixed in 3.5 by #48327.

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

Successfully merging a pull request may close this issue.

8 participants