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

SkeletonIK3D bone roll axis is not working correctly #77271

Closed
Tracked by #1
fracteed opened this issue May 20, 2023 · 4 comments · Fixed by #77469
Closed
Tracked by #1

SkeletonIK3D bone roll axis is not working correctly #77271

fracteed opened this issue May 20, 2023 · 4 comments · Fixed by #77469

Comments

@fracteed
Copy link

fracteed commented May 20, 2023

Godot version

4.0.2

System information

Windows 10 960m

Issue description

When using the skeltonIK3d on a simple bone chain, the roll axis of bones are not working correctly. As can be seen in this clip comparing 3.5 to 4.0.2, when moving the ik target on the x axis, the bone roll of the shin bone twists in a very strange way.

When the ik target is just moving up and down on the y axis 4.0.2 looks the same as 3.5. I have tried many ways of setting the roll axis in blender before exporting, but this seems to make no difference in godot.

ik_roll_bug.mp4

@lyuma I also tried this with your recent fix in master and it does not fix this issue, unfortunately. I did try the scorpion demo scene and I can see that it resolved that. Simple 2 or 3 bone chains seem to exhibit this odd roll issue...maybe the long chain on the scorpion tail is covering up the issue?

On a side note, I am getting tons of crashes trying to test out simple ik with the standard tool script. Especially just clicking in the skeletonik3d node.

Steps to reproduce

  • import a simple 2 or 3 bone skeleton such as a leg
  • add a skeltonik3d node
  • fill in the node parameters and add a marker3d as target
  • add a tool script to start off the ik solve
  • move the ik target on the x axis and observe the twisting

Minimal reproduction project

This has the 3.5, 4.0.2 file and the blend file

ik_roll_bug.zip

@fracteed fracteed changed the title SkeletonIK3D bone roll angles are not working correctly SkeletonIK3D bone roll axis is not working correctly May 20, 2023
@GeorgeS2019
Copy link

GeorgeS2019 commented May 21, 2023

@fracteed confirmed the reported bug using the latest commit (less than 1 day)

@lyuma
Copy link
Contributor

lyuma commented Jun 2, 2023

Thanks for all the testing, and for clarifications in the comments on #77469. Sorry I forgot to post an update last week, but I made progress and verified that this was indeed a regression in 4.x that was not present in 3.x and seems to still be an issue regardless of humanoid retarget and regardless of the other bugfixes.

I was out for a week but I'm pretty confident I will be able to get to the bottom of this issue by the time 4.1 is released. I'll keep you all updated.

@fracteed
Copy link
Author

fracteed commented Jun 2, 2023

Thanks for the update @lyuma . I am very much looking forward to this, and will do some extensive testing when there is a new PR!

@lyuma
Copy link
Contributor

lyuma commented Jun 6, 2023

Can you verify the updated PR on #77469 and see if it works for you? The issue was 3.x called Basis::rotated() and 4.0 calls the new rotate_to_align, which must do a left-multiply to match Basis::rotated.

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.

4 participants