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

Rework Skeleton3D for IK, MotionTracking and etc. to robustly resolve process order issues with AnimationMixer #9015

Closed
TokageItLab opened this issue Feb 3, 2024 · 0 comments · Fixed by godotengine/godot#87888
Labels
breaks compat Proposal will inevitably break compatibility topic:animation topic:3d
Milestone

Comments

@TokageItLab
Copy link
Member

TokageItLab commented Feb 3, 2024

Describe the project you are working on

Stabilize Godot animation system

Describe the problem or limitation you are having in your project

Godot still does not have a foundation for modification Skeleton3D like IK, SpringBone and etc.

Nodes that can modify some Skeletons use pose_override, but since a Skeleton can only have one override, only one Node that uses override can be applied per bone. There are enough possible use cases where IK is combined with something like PhysicalBone, or where more than two IK affects a single Bone, so pose should be used instead of pose_override.

By the way, although AnimationMixer uses pose instead of pose_override, the process order with Nodes that use pose depends on the order of the scene tree. For imported scenes, this is a problem because the order of Skeleton and AnimationMixer depends on the importer unless it is localized.

It can be controlled by the process priority property, but this is not good for usability because users have to constantly worry about priority.

Moreover, it is not clear whether the Idle or Physics process should be used depending on the Node that can modify the Skeleton. If you want to have the influence of both the AnimationMixer and the Node that can deform the Skeleton, they need to match.

See also godotengine/godot#87428.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Implements the base for adding Nodes that may modify Skeleton3D, such as IK, Constraint, SpringBone, etc. such as #8374, #6039.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Implement SkeletonModifier3D as a base class for Nodes that may modify Skeleton3D

SkeletonModifier3D retrieves a Skeleton by either having a Skeleton parent or by specifying an external Skeleton. This is almost the same way as the current BoneAttachment.

SkeletonModifier3D, like AnimationMixer, allows the user to select a process as CallbackModeProcess. Also, by specifying a target AnimationMixer, it is possible to process the animation in the same process as the AnimationMixer. At this time, SkeletonModifier3D always performs modification after the AnimationMixer.

In other words, the actual SkeletonModifier3D process only registers its own ObjectID with AnimationMixer. AnimationMixer performs modification after the registered SkeletonModifier3D playback process. If AnimationMixer has already processed the animations at the time of registration, SkeletonModifier3D will not register it and will perform modification on the fly.

This allows the processing order of SkeletonModifier3D to depend on the scene tree order and ProcessPriority, and prevents modifications from overwriting animations.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Never

Is there a reason why this should be core and not an add-on in the asset library?

This is a refactoring of the core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks compat Proposal will inevitably break compatibility topic:animation topic:3d
Projects
None yet
1 participant