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

Skeleton3D Rest Pose Does Not Effect Final Pose As Expected #75343

Open
Kalcen opened this issue Mar 26, 2023 · 4 comments
Open

Skeleton3D Rest Pose Does Not Effect Final Pose As Expected #75343

Kalcen opened this issue Mar 26, 2023 · 4 comments

Comments

@Kalcen
Copy link

Kalcen commented Mar 26, 2023

Godot version

v4.0.1.stable.official [cacf499]

System information

Windows 10

Issue description

I'm trying to change a bone's rest pose transform by editing its scale, but it doesn't seem to have any effect when playing an animation clip. The animation clip has no keyframes for scale, and I changed some import settings such as [AnimationPlayer -> Compression -> false], and [AnimationPlayer -> Import Tracks -> Scale -> Never] just in case. However I expect the scale to take effect regardless of what keyframes are in the animation based on this excerpt from the description section of Skeleton3D:

The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose.

If this isn't the intended use for rest pose, then the next best option I'm guessing would be the "custom pose", but I can't find any mention of the custom pose anywhere else besides in Skeleton3D's description.

2023-03-25.22-13-43_Trim.mp4

Steps to reproduce

  • open test.tscn
  • enable [Skeleton3D -> Show Rest Only]
  • change the Bone 2 Scale value on the "test" root node.
  • disable [Skeleton3D -> Show Rest Only]
  • play an animation

Minimal reproduction project

RestPoseIssue.zip

@TokageItLab
Copy link
Member

TokageItLab commented Mar 28, 2023

This is the intended behavior of Godot4; in Godot3 the Pose was relative to the Rest, but in Godot4 the Rest is now included in the Pose.

If you want to apply the scale of Rest to the final pose, you need to add it to the AnimationTree's NodeAdd, script the scale to the Pose itself, or use the RealTimeRetarget module to apply a LocalTransform (equivalent to Godot3's Pose system). Well, the custom module is a pain to install, so I am planning to make it an add-on later.

@Kalcen
Copy link
Author

Kalcen commented Mar 29, 2023

but in Godot4 the Rest is now included in the Pose.

I really don't understand what that means. here's my understanding: pose = keyframes of current animation. So then shouldn't there be something underneath those keyframes, and wouldn't it make sense to assume that they would be labeled as the rest pose? Also if the rest pose is "included" in the pose, then shouldn't any changes to the rest pose persist in the pose? I don't understand the difference between the two descriptions you gave. Also what's the deal with custom pose??

you need to add it to the AnimationTree's NodeAdd-

There's no such thing as NodeAdd in AnimationTree, do you mean the Add2 node? Because I tried to add the RESET pose (animation with no keyframes named RESET) to the test animation with keyframes and nothing changed.

Unnamed2

Scripting the scale is definitely an option (albeit becomes a nightmare when trying to keep a child bone from being skewed from a parent bone's non-uniform scale, but that's a whole separate issue I plan to submit at some point). But I thought that there would be a more straight forward approach to this given the way the docs describe things.

@TokageItLab
Copy link
Member

TokageItLab commented Mar 29, 2023

It means that:

  • Godot 3
    • Initial Bone Pose = Transform()
    • Final Displayed Bone Pose = Bone Rest * Bone Pose
  • Godot 4
    • Initial Bone Pose = Bone Rest
    • Final Displayed Bone Pose = Bone Pose

This change was made primarily because the model output from Maya does not have a Rest, and to allow simpler retargeting with simpler data. See also Animation data rework for 4.0.

However, there is certainly a disadvantage if you want the Rest to have any information, so an alternative is the implementation of the RealTimeRetarget plugin.

@TokageItLab
Copy link
Member

Well, for those who don't need an exaggerated implementation like RealTimeRetarget, we can distribute a custom class as an add-on that simply extends AnimationPlayer to reproduce Godot 3's behavior. Sorry, but I'm busy with other things at the moment, so please wait a while.

@TokageItLab TokageItLab self-assigned this Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants