Skip to content

Inspector v2: Animation Retargeting Extension#18135

Draft
Popov72 wants to merge 34 commits intoBabylonJS:masterfrom
Popov72:inspectorv2-art-extension
Draft

Inspector v2: Animation Retargeting Extension#18135
Popov72 wants to merge 34 commits intoBabylonJS:masterfrom
Popov72:inspectorv2-art-extension

Conversation

@Popov72
Copy link
Copy Markdown
Contributor

@Popov72 Popov72 commented Mar 19, 2026

You can find explanations of the main user interface in the documentation, as it is virtually identical to that of the animation retargeting tool, except that it uses React instead of LilGUI:

https://doc.babylonjs.com/features/featuresDeepDive/animation/animationRetargeting/

Below you will find a brief overview of the new retargeting configuration dialog, a new feature of this extension. The configuration is saved to local storage, with the exception of drag-and-drop files (avatars and animations), which are saved to IndexedDB.

Please feel free to test the extension thoroughly and don't hesitate to suggest any changes — this was built with the help of AI, and it will happily do the work to iterate on feedback! 🤖✨

Test link: https://playground.babylonjs.com/?snapshot=refs/pull/18135/merge

Note: to show the specific viewport of the extension, click on the "Eye" icon:

image

Important: There is no link (yet) between the current playground and the extension! The extension displays its window on top of the current scene and is completely independent. It would certainly be interesting to be able to interact with the scene by importing an avatar or animation into the extension, then exporting the retargeting code to the playground. This is something we should discuss, as I’m not exactly sure how to go about it (can we update the current plaground by injecting some code from the extension, for e.g.?).

Creating avatars and animations from the current scene is now possible, as well as exporting the retargeting code to the current PG.

To do that, I needed a bridge between the inspector and the PG, to be able to update/create files in the PG. cc @ryantrem to check if I (AI!) did it the right way.

🎛️ Retargeting Configuration Dialog

The configuration dialog is accessed via the Configuration icon (⚙) in the extension header. It manages all resources used by the animation retargeting tool and is organized into four tabs.


🧑‍🎤 Avatars Tab

Manage avatar models that appear in the main UI's Avatar dropdown.

Feature Description
Name A user-chosen label for the avatar entry
URL Load from a remote URL (press Enter or blur to load)
Drag & Drop Drop .glb, .gltf, or .babylon file(s) to load locally
Node Tree After loading, pick the root node from the scene hierarchy
Naming Scheme Auto-detected from bone names (min. 10 matches), or pick manually
Rest Pose Data JSON textarea for bone corrections — use gizmos + "Save as rest pose" to generate

💡 Tip: For .babylon format files, skeleton bone names are also checked for naming scheme auto-detection.


🎬 Animations Tab

Manage animation files that appear in the main UI's Animation dropdown.

Feature Description
Name A user-chosen label for the animation file entry
URL / Drag & Drop Same loading options as avatars
Animation Groups All groups in the file are listed — assign a display name to include them in the dropdown
Root Node Select the root node for skeleton visualization (shown on the right side of the viewport)
Naming Scheme Auto-detected from animation target names
Rest Pose Data Same concept as avatars

💡 Tip: Leave a display name empty to exclude that animation group from the tool.


🦴 Naming Schemes Tab

Manage bone naming conventions used to match bones between avatars and animations.

  • Add / Edit — Enter a scheme name and list bone names, one per line.
    Use 2-space indentation to indicate parent-child hierarchy. Used solely as a visual aid in the "Scheme Remappings" tab.
  • Populate from — Auto-fill the bone list from an existing avatar (skeleton bones) or animation (animation targets), preserving the hierarchy.
  • Recreate Defaults — Restores the built-in schemes:
    • Mixamo (e.g. mixamorig:Hips)
    • Mixamo No Namespace (e.g. Hips)
  • Delete protection — A scheme cannot be deleted if it's referenced by any avatar or animation.

🔗 Scheme Remappings Tab

Define how bones map between different naming schemes.

  • Bidirectional — A→B is the same as B→A (the inverse is computed automatically).
  • Transitive — If A→B and B→C exist, the tool can derive A→C automatically via Breadth-First Search.
Feature Description
Add / Edit Select From and To schemes, then map each source bone to a target bone
Swap (↕) Swap From/To schemes and invert the mapping
Duplicate detection Target bones mapped more than once are highlighted in red
Recreate Defaults Restores built-in remappings between Mixamo and Mixamo No Namespace

📦 Import / Export

Two buttons in the dialog title bar:

Button Description
Export (⬇) Downloads retargeting-config.json with all avatars, animations, naming schemes, and remappings. File-based entries are included as base64 data.
Import (⬆) Loads a .json file and offers two modes:
  • Replace — Clears all existing data and imports everything from the file.
  • Append — Adds new entries, skipping any with duplicate names (a summary of skipped items is shown).

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

Snapshot stored with reference name:
refs/pull/18135/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18135/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18135/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/18135/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18135/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18135/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18135/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/18135/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/?snapshot=refs/pull/18135/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

Building or testing the sandbox has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

Building or testing the playground has failed.

If the tests failed, results can be found here:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/testResults/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 19, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 24, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 24, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/?snapshot=refs/pull/18135/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 24, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 24, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 24, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

Snapshot stored with reference name:
refs/pull/18135/merge

Test environment:
https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18135/merge/index.html

To test a playground add it to the URL, for example:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/refs/pull/18135/merge/index.html#WGZLGJ#4600

Links to test your changes to core in the published versions of the Babylon tools (does not contain changes you made to the tools themselves):

https://playground.babylonjs.com/?snapshot=refs/pull/18135/merge
https://sandbox.babylonjs.com/?snapshot=refs/pull/18135/merge
https://gui.babylonjs.com/?snapshot=refs/pull/18135/merge
https://nme.babylonjs.com/?snapshot=refs/pull/18135/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/18135/merge#BCU1XR#0

If you made changes to the sandbox or playground in this PR, additional comments will be generated soon containing links to the dev versions of those tools.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/?snapshot=refs/pull/18135/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

…o-scaling

- Shared engine: use PG engine, save/restore render loops, scene dispose observer
- Scene import: SceneTransfer class for cross-scene node transfer with _scene patching
- Export to Scene: PlaygroundBridge service, retargeting.ts with incremental functions
- Export to Playground: loading state, onBeforeOpen callback, animation group index
- Multi-file support: base64 encoding with files: protocol for gltf+bin+textures
- Auto-scaling: preserve sign of scaling components for avatar and animation
- Node selection: index-based (no duplicate name issues), naming scheme re-detection
- PG Play button: auto-disable extension, try-catch guards in dispose
- Lint: inline type imports, merged duplicates, JSDoc completeness, naming conventions
- UI: Fluent tokens for fontSize, Caption1/Body1 for text, shared-ui Textarea

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/?snapshot=refs/pull/18135/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18135/merge/

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18135/merge/?snapshot=refs/pull/18135/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

@bjsplat
Copy link
Copy Markdown
Collaborator

bjsplat commented Mar 31, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants