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

Fix Silhoutte breaks some meshes in A-Pose #76448

Closed
lyuma opened this issue Apr 25, 2023 · 3 comments · Fixed by #76499
Closed

Fix Silhoutte breaks some meshes in A-Pose #76448

lyuma opened this issue Apr 25, 2023 · 3 comments · Fixed by #76499

Comments

@lyuma
Copy link
Contributor

lyuma commented Apr 25, 2023

Godot version

4.0.2-stable

System information

Windows 10

Issue description

I have a model in A-Pose. I was expecting to be able to import this model to Godot using its humanoid retargeter, by adapting it to T-Pose with the Fix Silhouette option. As noted in the documentation, this option "should be enabled for A-pose models.".

However, the resulting mesh looks wrong. In contrast, the resulting skeleton/armature looks correct.
silhouette_fix_bug
If the mesh deformed with this armature, it should not have been broken in this way, so it must be caused by a bug.

Here is the real world example which inspired this testcase. However, it is a paid asset and cannot be redistributed.
BoneMap but without Fix Silhouette. The bone rotations are not suitable for animation retargeting because the original model was in A-pose.
image
BoneMap with Fix Silhouette. The animations now line up correctly, but the model's mesh or bind poses now appear to be corrupt.
image

Steps to reproduce

  1. Open the attached project
  2. Allow the models to import.
  3. In main_scene, compare the models in front (no Fix Silhouette) to the model behind (Fix Silhouette). They should look the same, except one will be in A-Pose and the other in T-Pose.

Minimal reproduction project

SilhouetteFix.zip
Here is the blender model pre-export fix_silhouette.blend.zip

@lyuma
Copy link
Contributor Author

lyuma commented Apr 25, 2023

As an experiment, I rotated the bones so that they are all facing Y-forward. However, the issue still happens, so it should rule this out as the cause.
image
image

Here are the blend and glb files with bones facing forward in Y
fix_silhouette_rotated.blend.zip
apose_silhouette_fix2.glb.zip

@TokageItLab
Copy link
Member

TokageItLab commented Apr 25, 2023

It seems that for some reason Use Named Skin cannot be enabled and the skin/bone bindings are broken. It may be necessary to fix this so that bone idx is prioritized when Use Named Skin is disabled. Not relevant, looks like I stepped on another bug.

Perhaps the cause is this change #65278, something is not calculated correctly since fix silhouette seems to work correctly in alpha 15.

@lyuma
Copy link
Contributor Author

lyuma commented Apr 27, 2023

Fixed some weight painting issues so each front/back triangle is attached to exactly one bone. It is now easy to tell that RightUpperLeg, RightShoulder, RightUpperArm, RightLowerArm, Neck and Head are really far off. LeftShoulder also looks a little bit offset.

glb plus .import: apose_silhouette_fix2.glb.zip
blend file: fix_silhouette_rotated.blend.zip
image

@akien-mga akien-mga modified the milestones: 4.x, 4.1 Apr 27, 2023
lyuma added a commit to lyuma/godot that referenced this issue Apr 28, 2023
Fixes bind pose mistake from using i (mesh skin index) instead of bone_idx (skeleton bone index).
Fixes godotengine#76448
akien-mga pushed a commit to akien-mga/godot that referenced this issue May 12, 2023
Fixes bind pose mistake from using i (mesh skin index) instead of bone_idx (skeleton bone index).
Fixes godotengine#76448

(cherry picked from commit d33a734)
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.

3 participants