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

Incorrect interpolation using BlendNodes in AnimationTree #65771

Closed
raiseledwards opened this issue Sep 14, 2022 · 4 comments · Fixed by godotengine/godot-docs#6322
Closed

Incorrect interpolation using BlendNodes in AnimationTree #65771

raiseledwards opened this issue Sep 14, 2022 · 4 comments · Fixed by godotengine/godot-docs#6322

Comments

@raiseledwards
Copy link

Godot version

4.0 Alpha 17

System information

Windows 10 64bit

Issue description

When using any kind of blend node in AnimationTree bones interpolate incorrectly between poses.

Example:
image
image
image

The yellow cylinder is rotating only around the Z axiz from pose 1 to pose 2, notice how it's interpolation does not respect that, same interpolation between poses in blender:

image
image
image

This is a problem to blend more complex animations, here for example:

image
image
image

The arm is trying to rotate only around the X axis blending between two poses but it behaves incorrectly, which makes blend nodes unusable for creating something like an aiming system like in this scenario.

I don't use the animation optimizer when importing models.

Steps to reproduce

  • Open the godot project with Alpha 17 buil
  • Blend between poses in AnimationTree

Minimal reproduction project

Interpolation issue.zip

@Calinou Calinou added this to the 4.0 milestone Sep 14, 2022
@TokageItLab
Copy link
Member

Probably this is duplicate of #59536. Since Godot4's blending system does not allow more than 180 degrees of rotation from Rest for blending consistency, the Skeleton model should be imported with Rest as the midpoint of all poses (like T-pose) as much as possible.

@TokageItLab
Copy link
Member

TokageItLab commented Sep 15, 2022

FYI, here is the blend when setting Pose 1 as Rest in above sample project.

image

image

Interpolation_issue_fix.zip

@TokageItLab TokageItLab removed the bug label Sep 15, 2022
@raiseledwards
Copy link
Author

Guess this makes blend nodes not usable for animation systems that require bones to move in a precise and less restricted way and I should wait for the node replacement of SkeletonIK to be implemented, right? Should I close this issue?

@TokageItLab
Copy link
Member

TokageItLab commented Sep 15, 2022

You can close this if you don't think it is necessary, but I think it is fine to keep this open for others as it is easier to understand the problem than #59536. Anyway, I will close this as soon as I write the documentation for the new blend.

Guess this makes blend nodes not usable for animation systems that require bones to move in a precise and less restricted way

Simply the previous blend calculation was broken and needed to be fixed. In this issue's case caused by your project's Bone Rest being very different from both Pose 1 and Pose 2. So as long as we set the correct Rest, it should work correctly in most cases.

If you need more than 180 degrees of rotation with using BlendTree, something like #57959 might be useful, but it is basically a corner case, since more than 180 degrees of rotation in the human body means a fractured joint. Also, if you want to rotate the player itself, you can use RootMotion like #60774.

Well, if you simply want to rotate the bone to a specific point, then you are right to wait for the IK to rework is fine.

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