fix: spring bones fixed position#55
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: emotes in builder mode
…t/builder-mode-support
There was a problem hiding this comment.
Pull request overview
Fixes loading and animation behavior for wearables that include spring bone chains by ensuring GLTFast accepts vendor spring-bone extensions and by adjusting bone remapping so extra bones don’t get lost or left behind during emotes.
Changes:
- Registers spring-bone vendor extensions with GLTFast at startup to prevent load failures.
- Updates avatar/wearable bone remapping to preserve extra bones and attempts to reparent them under the live avatar skeleton so they follow emotes.
- Removes a large block of dead commented-out code in
GLTFLoader.Sanitize.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Assets/Scripts/Utils/AvatarUtils.cs | Remaps skinned mesh bones by name while preserving extra bones; adds hierarchy reparenting helper. |
| Assets/Scripts/Loading/GLTFLoader.cs | Deletes obsolete commented-out sanitization logic. |
| Assets/Scripts/Bootstrap.cs | Reflectively adds spring-bone extension(s) to GLTFast supported set on startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… bone re-parenting logic
Vercel Preview is ready!
|
…ang-renderer into feat/spring-bones-min
lorenzo-ranciaffi
approved these changes
Apr 10, 2026
lorenzo-ranciaffi
left a comment
Contributor
There was a problem hiding this comment.
Left a couple of cosmetic comments, looks good otherwise 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Problem
Wearables that include spring bone chains in their GLB files (e.g. hair physics, cloth physics using
DCL_spring_bone_jointorVRMC_springBoneextensions) had broken animation: wearables with more bones than the avatar skeleton (the extra bones being the spring bone chain) were rendered statically at a fixed world position during emotes. The avatar body would move but the spring bone wearable stayed behind.Changes
AvatarUtils.cs— Handle bone remapping for meshes with extra bonesSetupColorspreviously did a blanket replacement of everySkinnedMeshRenderer's bone array with the avatar's fixed skeleton. For wearables with spring bones this destroyed all extra bone references, causing broken joints.Now, when a wearable's renderer has more bones than the avatar skeleton, the code takes a different path:
RemapBonesPreservingExtras— instead of replacing the whole bone array, maps each bone slot by name to the corresponding live avatarTransform, preserving any slots whose names don't appear in the avatar skeleton (the spring bone chain transforms).ReparentExtraBonesUnderAvatarSkeleton— after per-renderer remapping, walks the entire wearable hierarchy and re-parents any transform that is not a live avatar bone under its nearest ancestor that is. This fixes the fixed-world-position bug: without it, spring bone chain roots remained as children of the wearable's own (unanimated)GameObject, so they stayed in place while the avatar moved during emotes. After re-parenting, they follow the live animated avatar bone (e.g., hair chains become children of the live Head transform).SetupColorscallsReparentExtraBonesUnderAvatarSkeletononly whenavatarBoneMapwas actually built (i.e., at least one renderer had more bones than the avatar skeleton), so there is no cost for normal wearables.GLTFLoader.cs— Remove dead commented-out codeRemoved a large block of commented-out code left from an earlier iteration of the
Sanitizemethod. No behaviour change.Bootstrap.cs— Whitespace cleanupMinor formatting change (added trailing newline). No behaviour change.
Screenshots
BEFORE:
Screen.Recording.2026-04-09.at.12.58.42.PM.mp4
AFTER:
Screen.Recording.2026-04-09.at.1.02.04.PM.mp4