-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
New and improved IK system for Skeleton2D - Squished #47872
New and improved IK system for Skeleton2D - Squished #47872
Conversation
The error in different builds is (this one is the windows version):
But I'm not sure what changed. Maybe a rebase went wrong? |
Possibly something went wrong with the rebase, but the non-squished version also had errors with the CI and it was likely the same thing. The only thing that changed though from the last successful CI build was changing the Looking at how other nodes override the function in their header, it uses the same syntax and formatting as they do, so I'm not sure why it isn't working here when it works there. Edit: Just build this PR locally and it compiles fine, no errors or anything. I'm not sure why the CI is getting different results. |
It's actually due to #43180, there's no conflict but you would have the same warnings if you rebased locally. This method now returns an array of strings instead of one string with line breaks. |
e6d653f
to
1b8e38f
Compare
The CI issue should be fixed. I rebased the PR with the latest version of However, there is an issue with the physical_bone_2d node that now that causes a segmentation fault. According to the stack trace, it is caused by the |
1b8e38f
to
4c92971
Compare
The segmentation fault issue has been fixed! Turns out it was an issue where the PhysicsBone2D was positioning itself at the Bone2D position in the Godot editor at start up. I removed the notification and it works fine. Removing it also shouldn't change anything functionally, the node can just now be moved around in the editor but it will snap itself into place when running. Now everything should be fixed and good to go. There is one minor thing, but I'm not sure it is related to this PR, is that the PhysicsBone2D spits out a bunch of the following error when run:
Which seems to be caused by line |
4c92971
to
2ba72f1
Compare
About the I'm able to reproduce it when running this scene from your test project: And I'm getting this callstack in debug:
So if it's related to the case you spotted, it's due to setting up a joint between a kinematic body and a static body (infinite inertia and mass are leading to a zeroed matrix). I'm not sure why this would have changed, but maybe the error wasn't spotted on version 3.2. Also it looks like the error wouldn't be raised in release_debug. In any case, I think this can be solved outside of this PR. It probably makes sense for the physics server to handle this case by just ignoring the joint, so I'll open a PR for that. |
Welp, looks like GitHub closes the whole PR when merging another one that fixes a comment. |
It was good in the end that this got closed and reopened as it restarted CI, and there's a new issue to handle: https://github.com/godotengine/godot/pull/47872/checks?check_run_id=2359849305 We merged #47414 yesterday so we now have @qarmin's
It might not be immediate to reproduce locally though, here's the config for the CI build that finds this crash: https://github.com/godotengine/godot/blob/master/.github/workflows/linux_builds.yml#L129-L170 Basically it builds Godot with |
This last lines before crash:
shows that probably this code is enough to reproduce crash
|
Thanks guys, I'll take a look at the issue once I have a chance 👍 |
Merging is blocked by:
|
7d60629
to
05ea296
Compare
This PR and commit adds a new IK system for 2D with the Skeleton2D node that adds several new IK solvers, a way to control bones in a Skeleton2D node similar to that in Skeleton3D. It also adds additional changes and functionality. This work was sponsored by GSoC 2020 and TwistedTwigleg. Full list of changes: * Adds a SkeletonModifier2D resource * This resource is the base where all IK code is written and executed * Has a function for clamping angles, since it is so commonly used * Modifiers are unique when duplicated so it works with instancing * Adds a SkeletonModifierStack2D resource * This resource manages a series of SkeletonModification2Ds * This is what the Skeleton2D directly interfaces with to make IK possible * Adds SkeletonModifier2D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK * Each modification is in its own file * There is also a SkeletonModifier2D resource that acts as a stack for using multiple stacks together * Adds a PhysicalBone2D node * Works similar to the PhysicalBone3D node, but uses a RigidBody2D node * Changes to Skeleton2D listed below: * Skeleton2D now holds a single SkeletonModificationStack2D for IK * Skeleton2D now has a local_pose_override, which overrides the Bone2D position similar to how the overrides work in Skeleton3D * Changes to Bone2D listed below: * The default_length property has been changed to length. Length is the length of the bone to its child bone node * New bone_angle property, which is the angle the bone has to its first child bone node * Bone2D caches its transform when not modified by IK for IK interpolation purposes * Bone2D draws its own editor gizmo, though this is stated to change in the future * Changes to CanvasItemEditor listed below: * Bone2D gizmo drawing code removed * The 2D IK code is removed. Now Bone2D is the only bone system for 2D * Transform2D now has a looking_at function for rotating to face a position * Two new node notifications: NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE * These notifications only are called in the editor right before and after saving a scene * Needed for not saving the IK position when executing IK in the editor * Documentation for all the changes listed above.
05ea296
to
8aa3c2f
Compare
I fixed the build and documentation issues, as well as rebased with the latest version of master. 👍 |
Thanks! |
This PR and commit adds a new IK system for 2D with the Skeleton2D node that adds several new IK solvers, a way to control bones in a Skeleton2D node similar to that in Skeleton3D. It also adds additional changes and functionality.
This work was sponsored by GSoC 2020 and TwistedTwigleg.
Once merged, the code in this PR will be up to the community to maintain. I will help advise and contribute small changes infrequently as best I can, but I cannot take the responsibility of maintaining and overseeing the code.
Huge thanks to everyone that has helped with this PR and getting the PR to this point! 🎉