Skip to content

feat: VRM export#180

Merged
nachomazzara merged 16 commits into
masterfrom
feat/vrm-export-v2
Jun 18, 2026
Merged

feat: VRM export#180
nachomazzara merged 16 commits into
masterfrom
feat/vrm-export-v2

Conversation

@nachomazzara

Copy link
Copy Markdown
Contributor

No description provided.

decentraland-bot and others added 11 commits May 20, 2026 13:34
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When wearables cover body parts, the base meshes are hidden via
setEnabled(false). The Babylon GLTF exporter does not skip disabled
meshes by default, so hidden body parts were being exported alongside
wearable meshes causing visual artifacts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous isEnabled() check was too aggressive — it filtered out
TransformNodes (skeleton bones) in addition to meshes, and checked
the full ancestor chain. Now uses instanceof AbstractMesh to only
filter actual mesh geometry, and isEnabled(false) to check only the
node's own state without traversing ancestors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ones

Each wearable container loads its own skeleton hierarchy. When exported
to GLTF, wearable meshes reference their own duplicate bone nodes
instead of the primary skeleton that the VRM humanoid mapping points to.
This causes wearable meshes to appear at wrong positions or be invisible
in VRM viewers.

Remap all GLTF skin joints to reference the first occurrence of each
bone name, unifying all meshes under a single skeleton.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Babylon GLTF exporter strips __root__ coordinate-conversion nodes
and disables right-handed conversion for their descendants (bones).
But center() reparents meshes under a different parent, so meshes still
get coordinate-converted while bones don't. This puts them in different
coordinate spaces, producing a 180-degree Y rotation on mesh geometry.

Apply a compensating 180-degree Y rotation to the parent node in the
GLTF JSON to re-align meshes with the bone coordinate space.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rdinate space

The GLTF exporter strips __root__ nodes and disables coordinate conversion
for their descendants. Since center() moves meshes out from under __root__
to a separate parent node, meshes got coordinate-converted but bones did
not — causing the upside-down orientation. Reparenting parent under __root__
before export ensures uniform treatment of all nodes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tively

The setParent(__root__) approach caused double Z-inversion: __root__ has
scale (1,1,-1) for GLTF→Babylon conversion, and reparenting parent under
it gave parent a compensating (1,1,-1) local scale. Combined with the
serializer's own Z inversion, wearable meshes ended up in the wrong
coordinate space. Fix: don't touch the hierarchy at all — just reset
parent's full transform (including rotation) to identity and let the
serializer handle handedness conversion on its own.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented May 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wearable-preview Ready Ready Preview, Comment Jun 17, 2026 11:06pm

Request Review

@nachomazzara nachomazzara changed the title Feat/vrm export v2 feat: VRM export May 20, 2026
Esteban Ordano and others added 2 commits June 18, 2026 00:46
… skin maps

Babylon 4.2's glTF serializer keys each exported image by the Babylon texture name; when two distinct textures share a name the second one's glTF texture entry aliases to the first image. DCL avatars reuse the name AvatarSkin_MAT (Base Color) across body parts that carry different image data (the head a clean 1024 skin map, the body a darker 2048 one), so the head inherited the body's map and rendered dark, feature-placeholder texels around the nose and eyes.

Make every texture name unique for the duration of the export, then restore so the live scene is untouched. Verified: head now references its own 1024 image, nose dark-pixel fraction 9 percent to 0 percent in a Blender VRM-addon import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-name-collision

fix(vrm-export): unique texture names so the serializer doesn't alias…
@nachomazzara nachomazzara merged commit cd360df into master Jun 18, 2026
3 checks passed
@nachomazzara nachomazzara deleted the feat/vrm-export-v2 branch June 18, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants