Fix XRBodyModifier3D hip driving for avatars no Root bone #89727
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The XRBodyModifier3D node fails to correctly drive avatars which have no Root bone. This occurs on common avatars such as ReadyPlayerMe, Mixamo, and AvaturnMe where the root bone of the skeleton is the hips. The importers Skeleton Retarget doesn't add a Root but instead leaves the Hips as the root bone but with the corrected name.
The XRBodyModifier3D code assumes their must always be a bone associated with the Root tracking joint, and picks bone 0 (the first bone) if it didn't find it by the correct bone name. Unfortunately if it does this with an avatar where bone 0 is the hips then it associates the hips with the root and locks the hips in place.
This PR removes the offending code:
godot/scene/3d/xr_body_modifier_3d.cpp
Lines 255 to 258 in 89f70e9
With this removed the behavior is as follows:
The following video demonstrates four different avatars moving correctly:
Avatars.mp4