feat: spring bones#3373
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…land/builder into feat/spring-bones
Pull Request Test Coverage Report for Build 23661386337Details
💛 - Coveralls |
There was a problem hiding this comment.
Pull request overview
Adds the Spring Bones editing workflow to the Builder item editor, including parsing spring bone data from wearable GLBs, exposing editable parameters in the Right Panel, pushing updates to the preview, and persisting changes by patching the GLB on save.
Changes:
- Introduces GLB/glTF parsing + patching utilities for spring bone
extras(read + write). - Adds editor state/actions/selectors/sagas to manage spring bone params, dirty-checking, and preview pushing.
- Implements the Spring Bones UI section (bone picker, sliders/inputs, center selection, copy/paste) and wires it into load/reset/save flows.
Reviewed changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/translation/languages/en.json | Adds Spring Bones UI translations (EN). |
| src/modules/translation/languages/es.json | Adds Spring Bones UI translations (ES). |
| src/modules/translation/languages/zh.json | Adds Spring Bones UI translations (ZH) and formats invalid_video. |
| src/modules/item/utils.ts | Adds helper to find a body-shape representation mainFile. |
| src/modules/item/utils.spec.ts | Unit tests for getRepresentationMainFile. |
| src/modules/item/sagas.ts | Patches GLBs on save when spring bone params changed, re-hashes contents. |
| src/modules/item/sagas.spec.ts | Updates existing save tests to account for new selector usage. |
| src/modules/editor/types.ts | Exposes SpringBoneParams and defines BoneNode. |
| src/modules/editor/selectors.ts | Adds bones/params selectors and “dirty” detection. |
| src/modules/editor/selectors.spec.ts | Adds tests for new editor selectors. |
| src/modules/editor/sagas.ts | Pushes spring bone params to preview (debounced + immediate). |
| src/modules/editor/reducer.ts | Stores bones/params in editor state; supports add/delete/reset; updates “original” on save success. |
| src/modules/editor/reducer.spec.ts | Tests for the new spring bone reducer behavior. |
| src/modules/editor/actions.ts | Adds spring bones actions (set bones/params, add/delete/reset, push). |
| src/modules/editor/actions.spec.ts | Tests for the new spring bones actions. |
| src/lib/glbUtils.ts | Adds GLB/glTF JSON extraction and GLB builder. |
| src/lib/glbUtils.spec.ts | Tests for GLB/glTF extraction and GLB building. |
| src/lib/parseSpringBones.ts | Parses nodes and spring bone params from GLB/glTF JSON. |
| src/lib/parseSpringBones.spec.ts | Tests for parsing + defaults/formatting/center validation. |
| src/lib/patchGltfSpringBones.ts | Patches spring bone params into GLB/glTF JSON (and rebuilds GLB). |
| src/lib/patchGltfSpringBones.spec.ts | Tests for patching correctness, padding, and BIN preservation. |
| src/components/ItemProvider/ItemProvider.types.ts | Adds bodyShape + callbacks to manage spring bone state. |
| src/components/ItemProvider/ItemProvider.tsx | Loads/clears/parses spring bones on item/bodyShape changes. |
| src/components/ItemProvider/ItemProvider.container.tsx | Wires bodyShape + spring bone actions to ItemProvider. |
| src/components/ItemEditorPage/RightPanel/SpringBonesSection/index.ts | Exports SpringBonesSection. |
| src/components/ItemEditorPage/RightPanel/SpringBonesSection/SpringBonesSection.types.ts | Props typing for SpringBonesSection. |
| src/components/ItemEditorPage/RightPanel/SpringBonesSection/SpringBonesSection.tsx | Implements Spring Bones editor UI and bone pickers. |
| src/components/ItemEditorPage/RightPanel/SpringBonesSection/SpringBonesSection.css | Styles for Spring Bones section and picker. |
| src/components/ItemEditorPage/RightPanel/RightPanel.types.ts | Adds spring bones props/actions to RightPanel types. |
| src/components/ItemEditorPage/RightPanel/RightPanel.tsx | Renders SpringBonesSection; includes spring-bone dirty state in Save/Reset. |
| src/components/ItemEditorPage/RightPanel/RightPanel.css | Adds padding to accommodate floating help button. |
| src/components/ItemEditorPage/RightPanel/RightPanel.container.tsx | Connects spring bones state/actions to RightPanel. |
| src/components/ItemEditorPage/CenterPanel/CenterPanel.types.ts | Adds onPushSpringBoneParams prop. |
| src/components/ItemEditorPage/CenterPanel/CenterPanel.tsx | Triggers immediate push on preview load and emote play. |
| src/components/ItemEditorPage/CenterPanel/CenterPanel.container.tsx | Wires pushSpringBoneParams dispatch. |
| package.json | Pins @dcl/schemas to a branch tgz and adds an override. |
| package-lock.json | Updates lockfile to match the new @dcl/schemas source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/components/ItemEditorPage/RightPanel/SpringBonesSection/SpringBonesSection.tsx
Outdated
Show resolved
Hide resolved
src/components/ItemEditorPage/RightPanel/SpringBonesSection/SpringBonesSection.tsx
Outdated
Show resolved
Hide resolved
| "CONTENTFUL_ADMIN_ENTITY_ID": "7FJAHnPOiCEHMJhrZ3sRmG", | ||
| "CREDITS_SERVER_URL": "https://credits.decentraland.zone", | ||
| "WEARABLE_PREVIEW_URL": "https://wearable-preview-git-feat-builder-mode-support-decentraland1.vercel.app/", | ||
| "WEARABLE_PREVIEW_URL": "https://wearable-preview-git-feat-spring-bones-decentraland1.vercel.app", |
There was a problem hiding this comment.
once the wearable-preview is deployed to .zone, could we update this to https://wearable-preview.decentraland.zone?
There was a problem hiding this comment.
Yes, of course. I'm waiting for this PR #3275 to be completed and merged first (depends on some aang changes that are pending)
|
|
||
| // When there are separate male/female GLB models, only patch the one | ||
| // matching the currently previewed body shape. When all representations | ||
| // share the same model (same content hash), patch all of them. |
There was a problem hiding this comment.
does this mean that I have to do 2 item saves?
what if I change the bodyShape preview before saving?
There was a problem hiding this comment.
-
If you submitted 2 different models for male & female: yes, you have to save twice, as both models may have different spring bones. You have to configure the spring bones for one model, save, change body shape and then repeat for the other model.
If you submitted only 1 model for both male & female: no, you save once and it applies for both male & female. -
You will loose your changes if you change body shape before saving 😅
Add Spring Bones Editor for Wearables
Related PRs:
Context and Problem Statement
Wearable creators need the ability to configure spring bone physics parameters (stiffness, gravity, drag force, etc.) directly within the Builder's item editor. Currently, there is no UI to parse, view, or edit spring bone data embedded in GLB/glTF wearable files, requiring creators to use raw blender custom properties.
Solution
Implement a full spring bones editing workflow: parsing spring bone data from GLB files, providing an interactive UI to tweak physics parameters, live-previewing changes in the wearable preview, and patching the GLB binary on save.
Key changes:
Testing
Spring Bones Section:
Preview:
Body shapes:
Screenshots
[Pending]
Pending tasks