Skip to content

Inspector v2: Animation Retargeting Extension#18135

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

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

Conversation

@Popov72
Copy link
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.

I also had to make a few minor changes to the "inspector shell" service (cc @ryantrem and @georginahalpern).

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.?).

🎛️ 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).

🔍 Inspector Shell Changes

The following changes were made to the inspector shell service (packages/dev/inspector-v2/src/services/shellService.tsx) to support the extension.

headerExtra property on SidePaneDefinition

A new optional property was added:

headerExtra?: ComponentType;

An optional React component rendered at the right side of the pane header, between the title and the dock menu button. Useful for adding icon-button actions specific to the pane (e.g. enable/disable toggle, console toggle, configuration dialog).

titleContent property on SidePaneDefinition

A new optional property was added:

titleContent?: ReactNode;

When provided, it replaces the plain text title in the pane header rendering, allowing extensions to embed rich content (e.g. clickable icons) directly inside the title area.

Property Type Purpose
title (existing) string Used for tooltips, teaching moments, error boundaries
titleContent (new) ReactNode Replaces plain text title in the header when provided
headerExtra (new) ComponentType Icon buttons rendered between title and dock menu

What changed:

  • SidePaneDefinition - Added headerExtra?: ComponentType and titleContent?: ReactNode
  • PaneHeader (internal component) - Accepts and renders both new props; renders titleContent ?? title inside <Subtitle2Stronger>, renders <headerExtra /> after the title
  • Both PaneHeader call sites (top and bottom pane areas) - Now pass titleContent and headerExtra through
  • React imports - Added ReactNode to the existing type imports

Backward compatibility: The plain title: string property is preserved and continues to be used for tooltips, teaching moments, and error boundaries. Existing panes that don't set titleContent or headerExtra are unaffected.

Motivation: The animation retargeting extension uses headerExtra for action buttons (enable/disable viewport, toggle console, open configuration dialog) and titleContent to embed a documentation link icon directly after the title text.

@bjsplat
Copy link
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
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
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
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
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 19, 2026

@bjsplat
Copy link
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
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
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
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 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
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 2026

@bjsplat
Copy link
Collaborator

bjsplat commented Mar 20, 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