-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Difference in Skeleton3D.get_bone_global_pose_no_override behavior for 4.1 #79136
Comments
Was just about to file the same bug report, all code that relied on get_bone_global_pose_no_override are now broken. [EDIT] Alright, the problem seems to lie here: godot/scene/3d/skeleton_3d.cpp Line 933 in b7c2fd2
Changing the requested parent's transform from a chain of pose_global_no_override to a chain of pose_global seems to fix it Just not quite sure if it's supposed to be a chain of pose no_override or not, maybe have an additional method to be able to get the requested bone with all past pose updates and another for a chain without overrides? |
In Godot 4.0.x, The good news is this: if your code worked properly in Godot 4.0, that means your code is designed to work with In short, this is not a bug, but it is something we should have indicated more clearly in the release notes. |
@lyuma not quite, the issue there is that the last bone, the one being requested, needs to be I was curious if that behavior was intended, so in that case we probably need a method that can return the above, the chain having all changes applied and the last bone on rest transform, otherwise we'd have to calculate the entire chain by hand. godot.windows.editor.x86_64_2023-07-07_09-47-53.mp4As you can see here, changing |
We actually have it documented in the release notes in the "Fixed > Animation" section:
I'm not sure where to put it aside from there to make it more prominent. That PR was also cherry-picked for 4.0.4 so it will be relevant there too. |
@akien-mga alright, I checked and the change does completely ruin IK, although all previous calls to
|
The explanation is way simpler. Read what I wrote. This is how the code looked in 4.0:
That is to say, in 4.0, Therefore, to upgrade your project from 4.0 to 4.1, replace your To demonstrate, I took your MRP project and did this change, and it solves the issue: Can you try this instead of the |
@lyuma it's because you're not taking into consideration animations, in all my examples I'm doing changes to bones while the skeleton is being animated, that's why you can't see the problem here, both Also like I mentioned here: #79136 (comment) |
Ok, I see what you mean. My apologies for being wrong about this. if (b.global_pose_override_amount >= CMP_EPSILON) {
b.pose_global = b.pose_global.interpolate_with(b.global_pose_override, b.global_pose_override_amount);
} So you are correct. To emulate what the old var parent_bone = skeleton3d.get_bone_parent(bone)
var parent_transform: Transform3D
if parent_bone != -1:
parent_transform = skeleton3d.get_bone_global_pose(parent_bone)
if skeleton3d.is_bone_enabled(bone):
return parent_transform * skeleton3d.get_bone_pose(bone)
else:
return parent_transform * skeleton3d.get_bone_rest(bone); |
Applying the |
I could finaly be able to control multiple bones in the same hierarchy with this |
Godot version
4.1.stable
System information
Windows 10
Issue description
In Godot 4.0.3 and earlier, Skeleton3D.get_global_bone_pose_no_override appears to take into account of all transformations and overrides of the parent bone, while in Godot 4.1, parent overrides are ignored.
Godot 4.0.3 behavior is more convenient for my use case, but I can't tell if it just has been wrong all this time, hence this bug.
Steps to reproduce
See comments in lines 13-20 of skeleton_test/main.gd for where the behavior differs.
Minimal reproduction project
skeleton_test.zip
The text was updated successfully, but these errors were encountered: