Retarget human motion from video to an Adobe Mixamo-rigged 3D character.
Python
Support Cinema 4D-exported Mixamo FBX rigs; release v0.1.7
MaxLiu83a68fef6efc
diff --git a/.github/RELEASE_NOTES_v0.1.7.md b/.github/RELEASE_NOTES_v0.1.7.mdnew file mode 100644index 0000000..38446de--- /dev/null+++ b/.github/RELEASE_NOTES_v0.1.7.md@@ -0,0 +1,33 @@+## Motion2MixamoRig v0.1.7++Motion2MixamoRig transfers human motion from a monocular video—or a pose from a still image—onto an Adobe Mixamo-rigged 3D character.++This release adds support for Mixamo characters that were edited and re-exported in Cinema 4D.++### Highlights++- **Cinema 4D-exported Mixamo FBX support**: use a character you opened and re-exported in Cinema 4D directly as the Mixamo rig, in the Blender add-on or with `--rig`. Details: [`docs/c4d-fbx-support.md`](https://github.com/MaxLiu22/Motion2MixamoRig/blob/v0.1.7/docs/c4d-fbx-support.md).+- **Fixed characters falling apart in the GLB**: each mesh piece now keeps its own skin bind matrices.+- **User guide in 18 languages**, matching the README.++### What you will notice++- In Blender the character now imports as one mesh object per piece (Y Bot: `skinned_mesh_0_Alpha_Surface` and `skinned_mesh_1_Alpha_Joints`) instead of a single `skinned_mesh`. The armature is still named `mixamo`, and the animation is unchanged.+- Original Mixamo characters produce the same motion as v0.1.6.++### Install the Blender add-on++1. Download `motion2mixamorig-0.1.7-macos-arm64.zip` from the assets below (do not unzip it). This release has a macOS (Apple Silicon) build only.+2. In Blender 4.2+: **Edit → Preferences → Get Extensions → ∨ → Install from Disk…**+3. Follow the [User Guide](https://github.com/MaxLiu22/Motion2MixamoRig/blob/v0.1.7/docs/user-guide.md).++Updating from v0.1.6: remove the old add-on, quit Blender, install this zip, then click **Update Runtime** (the C4D support lives in the runtime code, so this step is required). Downloaded models are kept.++### Important notes++* Tested on macOS (Apple Silicon) only. Windows and Linux are untested.+* Input currently supports one clearly visible, full-body person.+* The SMPL-X body model and Mixamo character must be obtained separately under their respective licenses.+* Non-commercial use only, because of upstream model licenses (see `NOTICE.md`).++Full changelog: [v0.1.6...v0.1.7](https://github.com/MaxLiu22/Motion2MixamoRig/compare/v0.1.6...v0.1.7)diff --git a/AGENTS.md b/AGENTS.mdindex 5a261fa..a5960d1 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -65,7 +65,7 @@ When helping a user:it, click **Install Runtime (one click)**, then **Choose SMPL-X Model…**.Own-venv path: the same venv + SMPL-X + Mixamo FBX as the CLI (see Setupabove).-2. Build `dist/motion2mixamorig-0.1.6-<platform>.zip` with+2. Build `dist/motion2mixamorig-0.1.7-<platform>.zip` with`python scripts/package_blender_extension.py --platform macos-arm64` (onezip per platform; the platform is declared in the zip's manifest, theversion is shared; the zip bundles `motion2mixamorig/` under `backend/`@@ -83,8 +83,8 @@ When helping a user:kept). If `already registered` / `EnumProperty could not register`appears: disable, **quit Blender fully**, reopen, install again.6. Jobs write `<project>/outputs/blender_jobs/<job-id>/`. After import, hide- **Icosphere** and the **armature** in the Outliner; leave **skinned_mesh**- visible. FPS must match the source clip duration (a 60 fps video tagged as+ **Icosphere** and the **armature** in the Outliner; leave the+ **skinned_mesh_…** objects (one per FBX geometry) visible. FPS must match the source clip duration (a 60 fps video tagged as30 fps plays at half speed).Smoke-test checklist: [`docs/blender-extension.md`](docs/blender-extension.md).@@ -111,4 +111,5 @@ Each run writes `outputs/<YYYYMMDD_HHMMSS>_<source>/`:- `blender_extension/README.md` — build the add-on, one-click runtime internals, own-venv setup- `docs/user-guide.md` — add-on guide for non-programmers- `docs/blender-extension.md` — maintainer smoke-test checklist-- `scripts/package_blender_extension.py` — build `dist/motion2mixamorig-0.1.6-<platform>.zip`+- `docs/c4d-fbx-support.md` — how Cinema 4D-exported FBX rigs are read (bind-matrix rest pose, one GLB skin per mesh)+- `scripts/package_blender_extension.py` — build `dist/motion2mixamorig-0.1.7-<platform>.zip`diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 367da72..df24ea5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.## [Unreleased]+## [0.1.7] - 2026-10-17++### Added++- Mixamo character FBXs re-exported from Cinema 4D are supported: the rest pose comes from the FBX bind matrices (`Pose`, then skin-cluster `TransformLink`, then local transforms) instead of `PreRotation` alone. See `docs/c4d-fbx-support.md`.+- The user guide and the README quick start are available in all 18 README languages.++### Changed++- The GLB has one mesh node and skin per FBX geometry, so Blender imports one `skinned_mesh_…` object per mesh piece (Y Bot: two) instead of a single `skinned_mesh`. The armature is still named `mixamo`. Animation and deformation are unchanged.++### Fixed++- GLB export reused the first mesh's inverse-bind matrices for every mesh piece, which could separate or collapse a character whose pieces have different bind matrices.+- `rest_skin_error_cm` compares in the same coordinate space as the skinned result, so it no longer reports a false error for meshes with their own bind transform.+## [0.1.6] - 2026-10-17### Addeddiff --git a/README.md b/README.mdindex 82231d7..62cdb56 100644--- a/README.md+++ b/README.md@@ -16,7 +16,7 @@ Transfer the motion of a person in a video — or the pose in a still photo —For game developers: give it a **single-person** action video (or a still) and a Mixamo character; it writes preview videos plus a skinned character file (`.glb`) you can drop into Blender or Unity.-> Motion2MixamoRig is currently experimental. Version 0.1.6 is the command-line pipeline. This repository also includes a Blender 4.2+ Extension that runs that same pipeline in an external Python environment. Building the add-on from source: [`blender_extension/README.md`](blender_extension/README.md).+> Motion2MixamoRig is currently experimental. Version 0.1.7 is the command-line pipeline. This repository also includes a Blender 4.2+ Extension that runs that same pipeline in an external Python environment. Building the add-on from source: [`blender_extension/README.md`](blender_extension/README.md).## Two ways to use it@@ -72,7 +72,7 @@ The pipeline runs without it, but the output videos will be **silent** and will## Before you run: put these in `assets/`-This repository does not ship these files; you have to fetch them. The SMPL-X filename must match the table exactly; FBX, video, and image names can be anything. A run needs SMPL-X, a Mixamo character, and **either** a video **or** a still.+This repository does not ship these files; you have to fetch them. The SMPL-X filename must match the table exactly; FBX, video, and image names can be anything. A run needs SMPL-X, a Mixamo character, and **either** a video **or** a still. Mixamo characters re-exported from Cinema 4D also work; see [`docs/c4d-fbx-support.md`](docs/c4d-fbx-support.md).| What | Where | Where to get it ||---|---|---|diff --git a/blender_extension/README.md b/blender_extension/README.mdindex 7839179..8dd2327 100644--- a/blender_extension/README.md+++ b/blender_extension/README.md@@ -89,7 +89,7 @@ From the repository root:python scripts/package_blender_extension.py --platform macos-arm64```-That writes `dist/motion2mixamorig-0.1.6-macos-arm64.zip`. The version comes+That writes `dist/motion2mixamorig-0.1.7-macos-arm64.zip`. The version comesfrom `version` in `blender_manifest.toml` and is the same on every platform;the platform goes into the file name and into `platforms` in the zip’s copy ofthe manifest, so Blender refuses to install it on another OS. The source@@ -98,7 +98,7 @@ manifest has no `platforms` line.- Platforms: `macos-arm64`, `macos-x64`, `windows-x64`, `windows-arm64`,`linux-x64`. Repeat `--platform` to build several zips at once.- Without `--platform` you get a platform-neutral- `dist/motion2mixamorig-0.1.6.zip` that installs anywhere. Use it for local+ `dist/motion2mixamorig-0.1.7.zip` that installs anywhere. Use it for localtesting only; releases ship per-platform zips.The zip root is `blender_manifest.toml` + `__init__.py` (no wrapping folder),@@ -116,7 +116,7 @@ In Blender 4.2+:Command line:```bash-blender --command extension install-file --repo user_default --enable dist/motion2mixamorig-0.1.6-macos-arm64.zip+blender --command extension install-file --repo user_default --enable dist/motion2mixamorig-0.1.7-macos-arm64.zip```After you change the add-on code, rebuild the zip and install it again. The@@ -174,7 +174,8 @@ one-click runtime, `<project>` is `~/Motion2MixamoRig/app`.- If the camera looks at empty space: select the character → **View → Frame Selected**.- The cluster of spheres on joints is bone display, not the mesh. In theOutliner, hide **Icosphere** and the **armature** (the row with pose /- armature / mesh icons). Leave **skinned_mesh** visible; it still deforms.+ armature / mesh icons). Leave the **skinned_mesh_…** objects visible (one+ per FBX geometry, e.g. `skinned_mesh_0_Alpha_Surface`); they still deform.- Playback speed follows the source clip’s duration (`fps` in `run.json`).## Devicesdiff --git a/blender_extension/motion2mixamorig_blender/blender_manifest.toml b/blender_extension/motion2mixamorig_blender/blender_manifest.tomlindex ae7e0b2..7a61505 100644--- a/blender_extension/motion2mixamorig_blender/blender_manifest.toml+++ b/blender_extension/motion2mixamorig_blender/blender_manifest.toml@@ -1,7 +1,7 @@schema_version = "1.0.0"id = "motion2mixamorig"-version = "0.1.6"+version = "0.1.7"name = "Motion2MixamoRig"tagline = "Transfer human motion from video to Mixamo characters"maintainer = "Max Liu"diff --git a/docs/c4d-fbx-support.md b/docs/c4d-fbx-support.mdnew file mode 100644index 0000000..a889b50--- /dev/null+++ b/docs/c4d-fbx-support.md@@ -0,0 +1,88 @@+# Cinema 4D-exported Mixamo FBX support++Since v0.1.7, the FBX loader accepts Mixamo character FBXs that were opened and+re-exported by Cinema 4D (and similar exporters that rewrite joint+transforms). Pass the file wherever a Mixamo rig is expected — `--rig`, or+**Mixamo Rig FBX** in the Blender add-on. It does not need to be re-saved in+Blender first.++## What changed++### Rest pose from bind matrices++Original Mixamo FBXs encode each joint's bind orientation in `PreRotation`.+Cinema 4D can bake that orientation into `Lcl Rotation` and drop+`PreRotation`. Rebuilding the rest pose from the local Euler properties alone+then gives a different joint frame, worse further down the hierarchy: a bad+rest pose and broken skinning, even with no animation applied.++The loader now reconstructs the rest pose in this priority order:++1. FBX `Pose` / `PoseNode.Matrix`, when present.+2. Skin-cluster `TransformLink`, for joints with no usable Pose record. When+ several meshes link the same joint, the matrix closest to all the others is+ used (rotation matrices are not averaged).+3. Local FBX transform properties, for joints without a bind matrix (usually+ end-site bones).++For a joint with a bind-world matrix, the local bind transform is derived+relative to its parent, and its rigid rotation is extracted from the matrix+(scale and shear removed). Animation rotations stay **deltas relative to the+bind orientation**. In the GLB, each joint node stores the recovered bind+transform and the animation channel stores the delta.++For original Mixamo FBXs this produces the same rest pose as before (see+[Validation](#validation)).++### One glTF skin per mesh piece++FBX skin clusters can store different inverse-bind matrices for each geometry+object, while a glTF skin has a single inverse-bind-matrix accessor. Earlier+versions reused the first geometry's matrices for every mesh piece, so joints+looked right in Blender while the mesh separated or collapsed. Each geometry is+now exported as its own glTF mesh node and skin; the joint hierarchy and the+animation are shared. This keeps the GLB and the preview renderer, which+already used per-geometry matrices, in agreement.++Visible effect in Blender: the character imports as one mesh object per FBX+geometry (for Y Bot, `skinned_mesh_0_Alpha_Surface` and+`skinned_mesh_1_Alpha_Joints`) instead of a single `skinned_mesh`. The armature+is still named `mixamo`.++## Usage++```bash+m2mr run --video assets/video/dance.mp4 --rig path/to/c4d-export.fbx+m2mr run --image assets/image/pose.jpg --rig path/to/c4d-export.fbx++# Reuse a previous extraction while changing the rig+m2mr run --skeleton outputs/<previous-run>/skeleton_motion.npz --rig path/to/c4d-export.fbx+```++## Validation++On a test pair (original Mixamo FBX and its Cinema 4D export):++| Check | Original Mixamo FBX | Cinema 4D FBX |+|---|---:|---:|+| Core bones | 25 | 25 |+| Full rig bones | 33 | 33 |+| Maximum full-rig rest-FK matrix error | `1.7e-14` | `3.2e-14` |+| Rest-skin error (cm) | `6.5e-14` | `2.0e-13` |++A Cinema 4D GLB smoke test confirmed that all seven mesh pieces receive their+matching skin matrices.++No regression for original Mixamo rigs: the same `skeleton_motion.npz` (787+frames) run on Y Bot before and after the change gives++- per-bone rotations within `4e-7` (float rounding),+- `rest_skin_error_cm` of `1.4e-5` (was `9.9e-5`),+- skinned vertex positions in Blender within `0.5 µm` on frames 1, 100, 300,+ and 600,+- and the same add-on import result (collection, FPS, frame range, hidden+ joint spheres).++`run.json` reports `rest_fk_error` and `rest_skin_error_cm` for every run;+both should stay near zero with a Cinema 4D rig too. Check a real motion run+visually in Blender as well.diff --git a/docs/i18n/README.ar.md b/docs/i18n/README.ar.mdindex eeb256c..e454bbd 100644--- a/docs/i18n/README.ar.md+++ b/docs/i18n/README.ar.md@@ -16,7 +16,7 @@للمطوّرين في مجال الألعاب: قدّم فيديو حركة لـ**شخص واحد** (أو صورة) وشخصية Mixamo؛ يكتب معاينات وملف شخصية مكسوّة (`.glb`) يمكن وضعه في Blender أو Unity.-> Motion2MixamoRig لا يزال تجريبيًا. الإصدار 0.1.6 هو مسار سطر الأوامر. يضم هذا المستودع أيضًا امتداد Blender 4.2+ يشغّل المسار نفسه في Python خارجي. بناء الإضافة من المصدر: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig لا يزال تجريبيًا. الإصدار 0.1.7 هو مسار سطر الأوامر. يضم هذا المستودع أيضًا امتداد Blender 4.2+ يشغّل المسار نفسه في Python خارجي. بناء الإضافة من المصدر: [`blender_extension/README.md`](../../blender_extension/README.md).## طريقتان للاستخدام@@ -72,7 +72,7 @@ pip install --upgrade pip setuptools wheel \## قبل التشغيل: ضع هذه في `assets/`-هذا المستودع لا يتضمّن هذه الملفات؛ ينبغي جلبها بنفسك. يجب أن يطابق اسم ملف SMPL-X الجدول حرفيًا؛ أما أسماء FBX والفيديو والصورة فحرة. يحتاج التشغيل إلى SMPL-X وشخصية Mixamo و**إما** فيديو **أو** صورة.+هذا المستودع لا يتضمّن هذه الملفات؛ ينبغي جلبها بنفسك. يجب أن يطابق اسم ملف SMPL-X الجدول حرفيًا؛ أما أسماء FBX والفيديو والصورة فحرة. يحتاج التشغيل إلى SMPL-X وشخصية Mixamo و**إما** فيديو **أو** صورة. شخصيات Mixamo المُعاد تصديرها من Cinema 4D مدعومة أيضًا؛ راجع [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| ماذا | أين | من أين ||---|---|---|diff --git a/docs/i18n/README.de.md b/docs/i18n/README.de.mdindex aec509f..610c9e5 100644--- a/docs/i18n/README.de.md+++ b/docs/i18n/README.de.md@@ -16,7 +16,7 @@Für Spieleentwickler: ein Video mit **genau einer Person** (oder ein Still) und ein Mixamo-Charakter; Ausgabe sind Vorschauen plus eine Charakterdatei mit Skinning (`.glb`) für Blender oder Unity.-> Motion2MixamoRig ist noch experimentell. Version 0.1.6 ist die Kommandozeilen-Pipeline. In diesem Repository liegt außerdem eine Blender-4.2+-Extension, die dieselbe Pipeline in einem externen Python ausführt. Add-on aus dem Quellcode bauen: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig ist noch experimentell. Version 0.1.7 ist die Kommandozeilen-Pipeline. In diesem Repository liegt außerdem eine Blender-4.2+-Extension, die dieselbe Pipeline in einem externen Python ausführt. Add-on aus dem Quellcode bauen: [`blender_extension/README.md`](../../blender_extension/README.md).## Zwei Wege zur Nutzung@@ -72,7 +72,7 @@ Ohne ffmpeg läuft die Pipeline, aber die Ausgabevideos sind **stumm** und spiel## Vor dem Lauf: dies nach `assets/` legen-Dieses Repository enthält diese Dateien nicht; sie müssen selbst besorgt werden. Der SMPL-X-Dateiname muss exakt zur Tabelle passen; FBX-, Video- und Bildnamen sind frei. Ein Lauf braucht SMPL-X, einen Mixamo-Charakter und **entweder** ein Video **oder** ein Still.+Dieses Repository enthält diese Dateien nicht; sie müssen selbst besorgt werden. Der SMPL-X-Dateiname muss exakt zur Tabelle passen; FBX-, Video- und Bildnamen sind frei. Ein Lauf braucht SMPL-X, einen Mixamo-Charakter und **entweder** ein Video **oder** ein Still. Aus Cinema 4D neu exportierte Mixamo-Charakter-FBX funktionieren ebenfalls; siehe [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Was | Wohin | Woher ||---|---|---|diff --git a/docs/i18n/README.es-MX.md b/docs/i18n/README.es-MX.mdindex 94b8046..2a633b3 100644--- a/docs/i18n/README.es-MX.md+++ b/docs/i18n/README.es-MX.md@@ -16,7 +16,7 @@ Transfiere el movimiento de una persona en un video — o la pose de una foto fiPara desarrolladores de videojuegos: dale un video de acción con **una sola persona** (o una foto) y un personaje de Mixamo; genera videos de vista previa y un archivo de personaje con skinning (`.glb`) que puedes llevar directo a Blender o Unity.-> Motion2MixamoRig todavía es experimental. La versión 0.1.6 es el pipeline de línea de comandos. Este repositorio también incluye una extensión para Blender 4.2+ que ejecuta ese mismo pipeline en un entorno de Python externo. Cómo compilar el complemento desde el código fuente: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig todavía es experimental. La versión 0.1.7 es el pipeline de línea de comandos. Este repositorio también incluye una extensión para Blender 4.2+ que ejecuta ese mismo pipeline en un entorno de Python externo. Cómo compilar el complemento desde el código fuente: [`blender_extension/README.md`](../../blender_extension/README.md).## Dos formas de usarlo@@ -72,7 +72,7 @@ El pipeline funciona sin él, pero los videos de salida quedarán **sin audio**## Antes de ejecutar: coloca estos archivos en `assets/`-Este repositorio no incluye estos archivos; tienes que conseguirlos tú. El nombre del archivo de SMPL-X debe coincidir exactamente con la tabla; los nombres del FBX, el video y la imagen pueden ser cualquiera. Cada ejecución necesita SMPL-X, un personaje de Mixamo y **o bien** un video **o bien** una foto.+Este repositorio no incluye estos archivos; tienes que conseguirlos tú. El nombre del archivo de SMPL-X debe coincidir exactamente con la tabla; los nombres del FBX, el video y la imagen pueden ser cualquiera. Cada ejecución necesita SMPL-X, un personaje de Mixamo y **o bien** un video **o bien** una foto. También funcionan los personajes de Mixamo reexportados desde Cinema 4D; consulta [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Qué | Dónde | Dónde conseguirlo ||---|---|---|diff --git a/docs/i18n/README.fil.md b/docs/i18n/README.fil.mdindex 3dc399e..6d28861 100644--- a/docs/i18n/README.fil.md+++ b/docs/i18n/README.fil.md@@ -16,7 +16,7 @@ Ilipat ang galaw ng isang tao sa video — o ang pose sa isang still na larawanPara sa mga game developer: bigyan ito ng action video na may **iisang tao** (o isang still) at isang Mixamo character; gagawa ito ng mga preview video at isang skinned na character file (`.glb`) na puwede mong ilagay agad sa Blender o Unity.-> Eksperimental pa ang Motion2MixamoRig sa ngayon. Ang bersyon 0.1.6 ay ang command-line pipeline. May kasama ring Blender 4.2+ Extension ang repository na ito na nagpapatakbo ng parehong pipeline sa isang hiwalay na Python environment. Pag-build ng add-on mula sa source: [`blender_extension/README.md`](../../blender_extension/README.md).+> Eksperimental pa ang Motion2MixamoRig sa ngayon. Ang bersyon 0.1.7 ay ang command-line pipeline. May kasama ring Blender 4.2+ Extension ang repository na ito na nagpapatakbo ng parehong pipeline sa isang hiwalay na Python environment. Pag-build ng add-on mula sa source: [`blender_extension/README.md`](../../blender_extension/README.md).## Dalawang paraan para gamitin ito@@ -72,7 +72,7 @@ Tatakbo ang pipeline kahit wala ito, pero **walang tunog** ang mga output video## Bago tumakbo: ilagay ang mga ito sa `assets/`-Hindi kasama sa repository na ito ang mga file na ito; kailangan mo silang kunin. Dapat eksaktong tugma sa table ang filename ng SMPL-X; puwedeng kahit ano ang pangalan ng FBX, video, at larawan. Kailangan ng bawat run ang SMPL-X, isang Mixamo character, at **alinman sa** isang video **o** isang still.+Hindi kasama sa repository na ito ang mga file na ito; kailangan mo silang kunin. Dapat eksaktong tugma sa table ang filename ng SMPL-X; puwedeng kahit ano ang pangalan ng FBX, video, at larawan. Kailangan ng bawat run ang SMPL-X, isang Mixamo character, at **alinman sa** isang video **o** isang still. Gumagana rin ang mga Mixamo character na ni-re-export mula sa Cinema 4D; tingnan ang [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Ano | Saan ilalagay | Saan kukunin ||---|---|---|diff --git a/docs/i18n/README.fr.md b/docs/i18n/README.fr.mdindex eea7d37..f493c01 100644--- a/docs/i18n/README.fr.md+++ b/docs/i18n/README.fr.md@@ -16,7 +16,7 @@ Transférez le mouvement d’une personne filmée — ou la pose d’une photoPour les développeurs de jeux : fournissez une vidéo d’action avec **une seule personne** (ou une photo) et un personnage Mixamo ; l’outil produit des vidéos d’aperçu ainsi qu’un fichier de personnage skinné (`.glb`) à importer directement dans Blender ou Unity.-> Motion2MixamoRig est encore expérimental. La version 0.1.6 correspond au pipeline en ligne de commande. Ce dépôt contient aussi une extension Blender 4.2+ qui exécute ce même pipeline dans un environnement Python externe. Compiler le module à partir des sources : [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig est encore expérimental. La version 0.1.7 correspond au pipeline en ligne de commande. Ce dépôt contient aussi une extension Blender 4.2+ qui exécute ce même pipeline dans un environnement Python externe. Compiler le module à partir des sources : [`blender_extension/README.md`](../../blender_extension/README.md).## Deux façons de l’utiliser@@ -72,7 +72,7 @@ Le pipeline fonctionne sans lui, mais les vidéos produites seront **muettes** e## Avant de lancer : placez ces fichiers dans `assets/`-Ce dépôt ne fournit pas ces fichiers ; vous devez les récupérer vous-même. Le nom du fichier SMPL-X doit correspondre exactement au tableau ; les noms des fichiers FBX, vidéo et image sont libres. Chaque exécution nécessite SMPL-X, un personnage Mixamo et **soit** une vidéo, **soit** une photo.+Ce dépôt ne fournit pas ces fichiers ; vous devez les récupérer vous-même. Le nom du fichier SMPL-X doit correspondre exactement au tableau ; les noms des fichiers FBX, vidéo et image sont libres. Chaque exécution nécessite SMPL-X, un personnage Mixamo et **soit** une vidéo, **soit** une photo. Les personnages Mixamo réexportés depuis Cinema 4D fonctionnent aussi ; voir [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Quoi | Où | Où l’obtenir ||---|---|---|diff --git a/docs/i18n/README.id.md b/docs/i18n/README.id.mdindex 7b16d1a..5a253ac 100644--- a/docs/i18n/README.id.md+++ b/docs/i18n/README.id.md@@ -16,7 +16,7 @@ Pindahkan gerakan seseorang dalam video — atau pose dalam sebuah foto — ke kUntuk developer game: berikan video aksi dengan **satu orang saja** (atau sebuah foto) dan satu karakter Mixamo; alat ini akan menghasilkan video pratinjau serta file karakter yang sudah di-skin (`.glb`) yang bisa langsung kamu masukkan ke Blender atau Unity.-> Motion2MixamoRig saat ini masih eksperimental. Versi 0.1.6 adalah pipeline baris perintah. Repositori ini juga menyertakan Blender 4.2+ Extension yang menjalankan pipeline yang sama di lingkungan Python eksternal. Membangun add-on dari source: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig saat ini masih eksperimental. Versi 0.1.7 adalah pipeline baris perintah. Repositori ini juga menyertakan Blender 4.2+ Extension yang menjalankan pipeline yang sama di lingkungan Python eksternal. Membangun add-on dari source: [`blender_extension/README.md`](../../blender_extension/README.md).## Dua cara memakainya@@ -72,7 +72,7 @@ Pipeline tetap berjalan tanpanya, tetapi video hasilnya akan **tanpa suara** dan## Sebelum menjalankan: taruh file-file ini di `assets/`-Repositori ini tidak menyertakan file-file berikut; kamu harus mengambilnya sendiri. Nama file SMPL-X harus sama persis dengan tabel; nama file FBX, video, dan gambar bebas. Setiap run membutuhkan SMPL-X, satu karakter Mixamo, dan **salah satu** dari video **atau** foto.+Repositori ini tidak menyertakan file-file berikut; kamu harus mengambilnya sendiri. Nama file SMPL-X harus sama persis dengan tabel; nama file FBX, video, dan gambar bebas. Setiap run membutuhkan SMPL-X, satu karakter Mixamo, dan **salah satu** dari video **atau** foto. Karakter Mixamo yang diekspor ulang dari Cinema 4D juga bisa dipakai; lihat [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Apa | Di mana | Dari mana ||---|---|---|diff --git a/docs/i18n/README.ja.md b/docs/i18n/README.ja.mdindex 2b3c2b3..d40fa51 100644--- a/docs/i18n/README.ja.md+++ b/docs/i18n/README.ja.md@@ -16,7 +16,7 @@ゲーム開発者向け:入力は**一人**の動作動画(または写真)と Mixamo キャラクター。プレビューと、Blender / Unity にそのまま入れられるスキン付きキャラクターファイル(`.glb`)を書き出します。-> Motion2MixamoRig はまだ実験段階です。v0.1.6 はコマンドラインのパイプラインです。このリポジトリの Blender 4.2+ Extension は、同じパイプラインを外部 Python で実行します。アドオンをソースからビルドする方法:[`blender_extension/README.md`](../../blender_extension/README.md)。+> Motion2MixamoRig はまだ実験段階です。v0.1.7 はコマンドラインのパイプラインです。このリポジトリの Blender 4.2+ Extension は、同じパイプラインを外部 Python で実行します。アドオンをソースからビルドする方法:[`blender_extension/README.md`](../../blender_extension/README.md)。## 2 つの使い方@@ -72,7 +72,7 @@ ffmpeg も推奨です(macOS: `brew install ffmpeg`、Ubuntu: `apt install ffm## 実行前:これらを `assets/` に入れてください-このリポジトリにはこれらのファイルは入っていません。自分で用意してください。SMPL-X のファイル名は下表と一字一句同じである必要があります。FBX、動画、写真の名前は何でも構いません。1 回の実行には SMPL-X、Mixamo キャラクター、そして**動画か写真のどちらか**が必要です。+このリポジトリにはこれらのファイルは入っていません。自分で用意してください。SMPL-X のファイル名は下表と一字一句同じである必要があります。FBX、動画、写真の名前は何でも構いません。1 回の実行には SMPL-X、Mixamo キャラクター、そして**動画か写真のどちらか**が必要です。 Cinema 4D で再エクスポートした Mixamo キャラクターの FBX も使えます。詳しくは [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md) を参照してください。| 何を | どこへ | どこから ||---|---|---|diff --git a/docs/i18n/README.ko.md b/docs/i18n/README.ko.mdindex 893582f..ea52c55 100644--- a/docs/i18n/README.ko.md+++ b/docs/i18n/README.ko.md@@ -16,7 +16,7 @@게임 개발자를 위한 도구입니다. **한 사람만** 나오는 동작 영상(또는 사진)과 Mixamo 캐릭터를 넣으면 미리보기와, Blender / Unity에 바로 넣을 수 있는 스키닝된 캐릭터 파일(`.glb`)을 생성합니다.-> Motion2MixamoRig는 아직 실험 단계입니다. v0.1.6은 명령줄 파이프라인입니다. 이 저장소의 Blender 4.2+ Extension은 같은 파이프라인을 외부 Python에서 실행합니다. 소스에서 애드온 빌드하기: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig는 아직 실험 단계입니다. v0.1.7은 명령줄 파이프라인입니다. 이 저장소의 Blender 4.2+ Extension은 같은 파이프라인을 외부 Python에서 실행합니다. 소스에서 애드온 빌드하기: [`blender_extension/README.md`](../../blender_extension/README.md).## 두 가지 사용 방법@@ -72,7 +72,7 @@ ffmpeg도 권장합니다(macOS: `brew install ffmpeg`, Ubuntu: `apt install ffm## 실행 전: 이것을 `assets/`에 넣으세요-이 저장소는 해당 파일을 포함하지 않습니다. 직접 준비해야 합니다. SMPL-X 파일명은 아래 표와 한 글자도 같아야 합니다. FBX, 영상, 사진 이름은 상관없습니다. 한 번의 실행에는 SMPL-X, Mixamo 캐릭터, 그리고 **영상 또는 사진 중 하나**가 필요합니다.+이 저장소는 해당 파일을 포함하지 않습니다. 직접 준비해야 합니다. SMPL-X 파일명은 아래 표와 한 글자도 같아야 합니다. FBX, 영상, 사진 이름은 상관없습니다. 한 번의 실행에는 SMPL-X, Mixamo 캐릭터, 그리고 **영상 또는 사진 중 하나**가 필요합니다. Cinema 4D에서 다시 내보낸 Mixamo 캐릭터 FBX도 사용할 수 있습니다. 자세한 내용은 [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md)를 참고하세요.| 무엇 | 어디에 | 어디서 ||---|---|---|diff --git a/docs/i18n/README.ne.md b/docs/i18n/README.ne.mdindex 1f446bc..ec4b73b 100644--- a/docs/i18n/README.ne.md+++ b/docs/i18n/README.ne.md@@ -16,7 +16,7 @@गेम डेभलपरहरूका लागि: **एक जना मात्र** व्यक्ति भएको एक्सन भिडियो (वा एउटा फोटो) र एउटा Mixamo क्यारेक्टर दिनुहोस्; यसले प्रिभ्यु भिडियोहरू र skin गरिएको क्यारेक्टर फाइल (`.glb`) बनाउँछ, जुन तपाईं सिधै Blender वा Unity मा राख्न सक्नुहुन्छ।-> Motion2MixamoRig अहिले प्रयोगात्मक चरणमा छ। संस्करण 0.1.6 कमान्ड-लाइन pipeline हो। यो रिपोजिटरीमा उही pipeline लाई बाहिरी Python वातावरणमा चलाउने Blender 4.2+ Extension पनि समावेश छ। सोर्सबाट एड-अन build गर्ने: [`blender_extension/README.md`](../../blender_extension/README.md)।+> Motion2MixamoRig अहिले प्रयोगात्मक चरणमा छ। संस्करण 0.1.7 कमान्ड-लाइन pipeline हो। यो रिपोजिटरीमा उही pipeline लाई बाहिरी Python वातावरणमा चलाउने Blender 4.2+ Extension पनि समावेश छ। सोर्सबाट एड-अन build गर्ने: [`blender_extension/README.md`](../../blender_extension/README.md)।## प्रयोग गर्ने दुई तरिका@@ -72,7 +72,7 @@ ffmpeg इन्स्टल गर्न सिफारिस गरिन्## चलाउनु अघि: यी फाइलहरू `assets/` मा राख्नुहोस्-यो रिपोजिटरीमा यी फाइलहरू समावेश छैनन्; तपाईं आफैंले ल्याउनुपर्छ। SMPL-X को फाइल नाम तालिकासँग ठ्याक्कै मिल्नुपर्छ; FBX, भिडियो र फोटोको नाम जुनसुकै हुन सक्छ। प्रत्येक run लाई SMPL-X, एउटा Mixamo क्यारेक्टर, र **कि त** एउटा भिडियो **कि त** एउटा फोटो चाहिन्छ।+यो रिपोजिटरीमा यी फाइलहरू समावेश छैनन्; तपाईं आफैंले ल्याउनुपर्छ। SMPL-X को फाइल नाम तालिकासँग ठ्याक्कै मिल्नुपर्छ; FBX, भिडियो र फोटोको नाम जुनसुकै हुन सक्छ। प्रत्येक run लाई SMPL-X, एउटा Mixamo क्यारेक्टर, र **कि त** एउटा भिडियो **कि त** एउटा फोटो चाहिन्छ। Cinema 4D बाट फेरि export गरिएका Mixamo पात्रहरू पनि चल्छन्; थप जानकारीका लागि [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md) हेर्नुहोस्।| के | कहाँ | कहाँबाट पाउने ||---|---|---|diff --git a/docs/i18n/README.nl.md b/docs/i18n/README.nl.mdindex 2b11a27..20365fa 100644--- a/docs/i18n/README.nl.md+++ b/docs/i18n/README.nl.md@@ -16,7 +16,7 @@ Zet de beweging van een persoon in een video — of de pose op een foto — overVoor gameontwikkelaars: geef een actievideo met **één persoon** (of een foto) en een Mixamo-personage op; het levert previewvideo's en een geskind personagebestand (`.glb`) dat je direct in Blender of Unity kunt laden.-> Motion2MixamoRig is momenteel experimenteel. Versie 0.1.6 is de command-line-pipeline. Deze repository bevat ook een Blender 4.2+ Extension die dezelfde pipeline in een externe Python-omgeving uitvoert. De add-on vanuit de broncode bouwen: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig is momenteel experimenteel. Versie 0.1.7 is de command-line-pipeline. Deze repository bevat ook een Blender 4.2+ Extension die dezelfde pipeline in een externe Python-omgeving uitvoert. De add-on vanuit de broncode bouwen: [`blender_extension/README.md`](../../blender_extension/README.md).## Twee manieren om het te gebruiken@@ -72,7 +72,7 @@ De pipeline werkt ook zonder, maar de uitvoervideo's zijn dan **zonder geluid**## Voordat je start: zet deze bestanden in `assets/`-Deze repository levert deze bestanden niet mee; je moet ze zelf ophalen. De bestandsnaam van SMPL-X moet exact overeenkomen met de tabel; de namen van FBX-, video- en afbeeldingsbestanden zijn vrij. Elke run heeft SMPL-X, een Mixamo-personage en **ofwel** een video **ofwel** een foto nodig.+Deze repository levert deze bestanden niet mee; je moet ze zelf ophalen. De bestandsnaam van SMPL-X moet exact overeenkomen met de tabel; de namen van FBX-, video- en afbeeldingsbestanden zijn vrij. Elke run heeft SMPL-X, een Mixamo-personage en **ofwel** een video **ofwel** een foto nodig. Mixamo-personages die opnieuw uit Cinema 4D zijn geëxporteerd werken ook; zie [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Wat | Waar | Waar te krijgen ||---|---|---|diff --git a/docs/i18n/README.pl.md b/docs/i18n/README.pl.mdindex b8e5bdc..9cf1499 100644--- a/docs/i18n/README.pl.md+++ b/docs/i18n/README.pl.md@@ -16,7 +16,7 @@ Przenieś ruch osoby z nagrania wideo — albo pozę ze zdjęcia — na postaćDla twórców gier: podaj nagranie akcji z **jedną osobą** (albo zdjęcie) i postać z Mixamo; narzędzie wygeneruje filmy podglądowe oraz plik postaci ze skinningiem (`.glb`), który możesz od razu wczytać do Blendera lub Unity.-> Motion2MixamoRig jest na razie eksperymentalny. Wersja 0.1.6 to pipeline wiersza poleceń. To repozytorium zawiera też rozszerzenie Blender 4.2+ Extension, które uruchamia ten sam pipeline w zewnętrznym środowisku Pythona. Budowanie dodatku ze źródeł: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig jest na razie eksperymentalny. Wersja 0.1.7 to pipeline wiersza poleceń. To repozytorium zawiera też rozszerzenie Blender 4.2+ Extension, które uruchamia ten sam pipeline w zewnętrznym środowisku Pythona. Budowanie dodatku ze źródeł: [`blender_extension/README.md`](../../blender_extension/README.md).## Dwa sposoby użycia@@ -72,7 +72,7 @@ Pipeline działa bez niego, ale wynikowe filmy będą **bez dźwięku** i nie od## Zanim uruchomisz: umieść te pliki w `assets/`-To repozytorium nie zawiera tych plików; musisz je pobrać samodzielnie. Nazwa pliku SMPL-X musi dokładnie odpowiadać tabeli; nazwy plików FBX, wideo i zdjęć są dowolne. Każde uruchomienie wymaga SMPL-X, postaci z Mixamo oraz **albo** wideo, **albo** zdjęcia.+To repozytorium nie zawiera tych plików; musisz je pobrać samodzielnie. Nazwa pliku SMPL-X musi dokładnie odpowiadać tabeli; nazwy plików FBX, wideo i zdjęć są dowolne. Każde uruchomienie wymaga SMPL-X, postaci z Mixamo oraz **albo** wideo, **albo** zdjęcia. Postacie Mixamo ponownie wyeksportowane z Cinema 4D też działają; zobacz [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Co | Gdzie | Skąd ||---|---|---|diff --git a/docs/i18n/README.ru.md b/docs/i18n/README.ru.mdindex d526e27..dafff82 100644--- a/docs/i18n/README.ru.md+++ b/docs/i18n/README.ru.md@@ -16,7 +16,7 @@Для разработчиков игр: видео с **одним человеком** (или фото) и персонаж Mixamo; на выходе превью и файл персонажа со скином (`.glb`) для Blender или Unity.-> Motion2MixamoRig пока экспериментален. Версия 0.1.6 — конвейер командной строки. В этом репозитории также есть расширение Blender 4.2+, которое запускает тот же конвейер во внешнем Python. Сборка аддона из исходников: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig пока экспериментален. Версия 0.1.7 — конвейер командной строки. В этом репозитории также есть расширение Blender 4.2+, которое запускает тот же конвейер во внешнем Python. Сборка аддона из исходников: [`blender_extension/README.md`](../../blender_extension/README.md).## Два способа использования@@ -72,7 +72,7 @@ pip install --upgrade pip setuptools wheel \## Перед запуском: положите это в `assets/`-Репозиторий эти файлы не содержит — их нужно получить самостоятельно. Имя файла SMPL-X должно совпадать с таблицей буква в букву; имена FBX, видео и фото любые. Для запуска нужны SMPL-X, персонаж Mixamo и **либо** видео, **либо** фото.+Репозиторий эти файлы не содержит — их нужно получить самостоятельно. Имя файла SMPL-X должно совпадать с таблицей буква в букву; имена FBX, видео и фото любые. Для запуска нужны SMPL-X, персонаж Mixamo и **либо** видео, **либо** фото. Персонажи Mixamo, повторно экспортированные из Cinema 4D, тоже поддерживаются; подробнее: [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Что | Куда | Откуда ||---|---|---|diff --git a/docs/i18n/README.th.md b/docs/i18n/README.th.mdindex cbe6449..88b3fc6 100644--- a/docs/i18n/README.th.md+++ b/docs/i18n/README.th.md@@ -16,7 +16,7 @@สำหรับนักพัฒนาเกม: ใส่วิดีโอแอ็กชันที่มี **คนเพียงคนเดียว** (หรือภาพนิ่ง) กับตัวละคร Mixamo หนึ่งตัว เครื่องมือจะสร้างวิดีโอพรีวิวและไฟล์ตัวละครที่ skin แล้ว (`.glb`) ซึ่งนำไปใช้ใน Blender หรือ Unity ได้ทันที-> ขณะนี้ Motion2MixamoRig ยังอยู่ในขั้นทดลอง เวอร์ชัน 0.1.6 คือ pipeline แบบบรรทัดคำสั่ง รีโพนี้ยังมี Blender 4.2+ Extension ที่รัน pipeline เดียวกันใน Python environment ภายนอกด้วย การ build add-on จากซอร์สโค้ด: [`blender_extension/README.md`](../../blender_extension/README.md)+> ขณะนี้ Motion2MixamoRig ยังอยู่ในขั้นทดลอง เวอร์ชัน 0.1.7 คือ pipeline แบบบรรทัดคำสั่ง รีโพนี้ยังมี Blender 4.2+ Extension ที่รัน pipeline เดียวกันใน Python environment ภายนอกด้วย การ build add-on จากซอร์สโค้ด: [`blender_extension/README.md`](../../blender_extension/README.md)## สองวิธีในการใช้งาน@@ -72,7 +72,7 @@ pipeline รันได้แม้ไม่มี แต่วิดีโอ## ก่อนรัน: วางไฟล์เหล่านี้ไว้ใน `assets/`-รีโพนี้ไม่ได้แนบไฟล์เหล่านี้มา คุณต้องหามาเอง ชื่อไฟล์ SMPL-X ต้องตรงกับตารางทุกตัวอักษร ส่วนชื่อไฟล์ FBX วิดีโอ และภาพตั้งได้ตามใจ การรันแต่ละครั้งต้องมี SMPL-X ตัวละคร Mixamo หนึ่งตัว และ **อย่างใดอย่างหนึ่ง** ระหว่างวิดีโอ **หรือ** ภาพนิ่ง+รีโพนี้ไม่ได้แนบไฟล์เหล่านี้มา คุณต้องหามาเอง ชื่อไฟล์ SMPL-X ต้องตรงกับตารางทุกตัวอักษร ส่วนชื่อไฟล์ FBX วิดีโอ และภาพตั้งได้ตามใจ การรันแต่ละครั้งต้องมี SMPL-X ตัวละคร Mixamo หนึ่งตัว และ **อย่างใดอย่างหนึ่ง** ระหว่างวิดีโอ **หรือ** ภาพนิ่ง ตัวละคร Mixamo ที่ export ใหม่จาก Cinema 4D ก็ใช้ได้เช่นกัน ดู [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md)| ไฟล์ | ตำแหน่ง | แหล่งที่มา ||---|---|---|diff --git a/docs/i18n/README.tr.md b/docs/i18n/README.tr.mdindex 4381ff7..a51f71e 100644--- a/docs/i18n/README.tr.md+++ b/docs/i18n/README.tr.md@@ -16,7 +16,7 @@ Bir videodaki kişinin hareketini — ya da bir fotoğraftaki pozu — Adobe MixOyun geliştiricileri için: **tek kişilik** bir aksiyon videosu (ya da bir fotoğraf) ve bir Mixamo karakteri verin; araç önizleme videoları ile Blender veya Unity'ye doğrudan aktarabileceğiniz skin'lenmiş bir karakter dosyası (`.glb`) üretir.-> Motion2MixamoRig şu anda deneysel aşamadadır. 0.1.6 sürümü komut satırı pipeline'ıdır. Bu depo ayrıca aynı pipeline'ı harici bir Python ortamında çalıştıran bir Blender 4.2+ Extension da içerir. Eklentiyi kaynak koddan derlemek için: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig şu anda deneysel aşamadadır. 0.1.7 sürümü komut satırı pipeline'ıdır. Bu depo ayrıca aynı pipeline'ı harici bir Python ortamında çalıştıran bir Blender 4.2+ Extension da içerir. Eklentiyi kaynak koddan derlemek için: [`blender_extension/README.md`](../../blender_extension/README.md).## İki kullanım yolu@@ -72,7 +72,7 @@ Pipeline onsuz da çalışır, ancak çıktı videoları **sessiz** olur ve tara## Çalıştırmadan önce: bunları `assets/` içine koyun-Bu depo bu dosyaları içermez; kendiniz edinmeniz gerekir. SMPL-X dosya adı tabloyla birebir aynı olmalıdır; FBX, video ve görsel adları serbesttir. Her çalıştırma için SMPL-X, bir Mixamo karakteri ve **ya** bir video **ya da** bir fotoğraf gerekir.+Bu depo bu dosyaları içermez; kendiniz edinmeniz gerekir. SMPL-X dosya adı tabloyla birebir aynı olmalıdır; FBX, video ve görsel adları serbesttir. Her çalıştırma için SMPL-X, bir Mixamo karakteri ve **ya** bir video **ya da** bir fotoğraf gerekir. Cinema 4D'den yeniden dışa aktarılan Mixamo karakterleri de desteklenir; ayrıntılar için [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md) dosyasına bakın.| Ne | Nereye | Nereden ||---|---|---|diff --git a/docs/i18n/README.vi.md b/docs/i18n/README.vi.mdindex a48b0b4..09099d3 100644--- a/docs/i18n/README.vi.md+++ b/docs/i18n/README.vi.md@@ -16,7 +16,7 @@ Chuyển chuyển động của một người trong video — hoặc tư thếDành cho nhà phát triển game: đưa vào một video hành động có **một người duy nhất** (hoặc một ảnh tĩnh) cùng một nhân vật Mixamo; công cụ sẽ xuất các video xem trước và một tệp nhân vật đã skin (`.glb`) để bạn kéo thẳng vào Blender hoặc Unity.-> Motion2MixamoRig hiện vẫn đang ở giai đoạn thử nghiệm. Phiên bản 0.1.6 là pipeline dòng lệnh. Kho mã này cũng có một Blender 4.2+ Extension chạy chính pipeline đó trong một môi trường Python bên ngoài. Tự build add-on từ mã nguồn: [`blender_extension/README.md`](../../blender_extension/README.md).+> Motion2MixamoRig hiện vẫn đang ở giai đoạn thử nghiệm. Phiên bản 0.1.7 là pipeline dòng lệnh. Kho mã này cũng có một Blender 4.2+ Extension chạy chính pipeline đó trong một môi trường Python bên ngoài. Tự build add-on từ mã nguồn: [`blender_extension/README.md`](../../blender_extension/README.md).## Hai cách sử dụng@@ -72,7 +72,7 @@ Pipeline vẫn chạy được khi không có nó, nhưng video đầu ra sẽ *## Trước khi chạy: đặt các tệp này vào `assets/`-Kho mã này không kèm các tệp dưới đây; bạn phải tự tải về. Tên tệp SMPL-X phải khớp chính xác với bảng; tên tệp FBX, video và ảnh thì tùy ý. Mỗi lần chạy cần SMPL-X, một nhân vật Mixamo, và **hoặc** một video **hoặc** một ảnh tĩnh.+Kho mã này không kèm các tệp dưới đây; bạn phải tự tải về. Tên tệp SMPL-X phải khớp chính xác với bảng; tên tệp FBX, video và ảnh thì tùy ý. Mỗi lần chạy cần SMPL-X, một nhân vật Mixamo, và **hoặc** một video **hoặc** một ảnh tĩnh. Nhân vật Mixamo được xuất lại từ Cinema 4D cũng dùng được; xem [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md).| Tệp | Vị trí | Nơi tải ||---|---|---|diff --git a/docs/i18n/README.zh-Hans.md b/docs/i18n/README.zh-Hans.mdindex e078d72..c41d712 100644--- a/docs/i18n/README.zh-Hans.md+++ b/docs/i18n/README.zh-Hans.md@@ -16,7 +16,7 @@面向游戏开发者:输入一段**单人**动作视频(或一张人物照片)和一个 Mixamo 角色,输出预览视频,以及可直接丢进 Blender / Unity 的带皮角色文件(`.glb`)。-> Motion2MixamoRig 目前仍处于实验阶段。v0.1.6 是命令行工作流。本仓库另有一个 Blender 4.2+ Extension,在外部 Python 里跑同一条 pipeline。从源码构建插件:[`blender_extension/README.md`](../../blender_extension/README.md)。+> Motion2MixamoRig 目前仍处于实验阶段。v0.1.7 是命令行工作流。本仓库另有一个 Blender 4.2+ Extension,在外部 Python 里跑同一条 pipeline。从源码构建插件:[`blender_extension/README.md`](../../blender_extension/README.md)。## 两种用法@@ -71,7 +71,7 @@ pip install --upgrade pip setuptools wheel \## 使用前:把这些东西放到 `assets/`-本仓库不附带这些文件,需要你自己准备。SMPL-X 的文件名必须和下表一字不差;FBX、视频和照片叫什么都行。一次运行需要 SMPL-X、一个 Mixamo 角色,以及**视频或照片二选一**。+本仓库不附带这些文件,需要你自己准备。SMPL-X 的文件名必须和下表一字不差;FBX、视频和照片叫什么都行。一次运行需要 SMPL-X、一个 Mixamo 角色,以及**视频或照片二选一**。 在 Cinema 4D 里重新导出的 Mixamo 角色 FBX 也可以使用,详见 [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md)。| 放什么 | 放到哪 | 去哪拿 ||---|---|---|diff --git a/docs/i18n/README.zh-Hant.md b/docs/i18n/README.zh-Hant.mdindex 1b34704..6269f8b 100644--- a/docs/i18n/README.zh-Hant.md+++ b/docs/i18n/README.zh-Hant.md@@ -16,7 +16,7 @@給遊戲開發者:輸入一段**單人**動作影片(或一張人物照片)和一個 Mixamo 角色,就會輸出預覽影片,以及可以直接放進 Blender / Unity 的已蒙皮角色檔(`.glb`)。-> Motion2MixamoRig 目前仍在實驗階段。v0.1.6 是命令列工作流程。本儲存庫另外提供一個 Blender 4.2+ Extension,會在外部的 Python 環境中執行同一條 pipeline。從原始碼建置外掛:[`blender_extension/README.md`](../../blender_extension/README.md)。+> Motion2MixamoRig 目前仍在實驗階段。v0.1.7 是命令列工作流程。本儲存庫另外提供一個 Blender 4.2+ Extension,會在外部的 Python 環境中執行同一條 pipeline。從原始碼建置外掛:[`blender_extension/README.md`](../../blender_extension/README.md)。## 兩種使用方式@@ -71,7 +71,7 @@ pip install --upgrade pip setuptools wheel \## 執行前:把這些檔案放到 `assets/`-本儲存庫不附帶這些檔案,需要你自行準備。SMPL-X 的檔名必須和下表完全一致;FBX、影片和照片的檔名可以隨意。每次執行需要 SMPL-X、一個 Mixamo 角色,以及**影片或照片二選一**。+本儲存庫不附帶這些檔案,需要你自行準備。SMPL-X 的檔名必須和下表完全一致;FBX、影片和照片的檔名可以隨意。每次執行需要 SMPL-X、一個 Mixamo 角色,以及**影片或照片二選一**。 在 Cinema 4D 中重新匯出的 Mixamo 角色 FBX 也能使用,詳見 [`docs/c4d-fbx-support.md`](../c4d-fbx-support.md)。| 放什麼 | 放在哪裡 | 去哪裡取得 ||---|---|---|diff --git a/docs/i18n/user-guide.ar.md b/docs/i18n/user-guide.ar.mdindex 6eb479c..e7d63e8 100644--- a/docs/i18n/user-guide.ar.md+++ b/docs/i18n/user-guide.ar.md@@ -29,7 +29,7 @@| Mac بمعالج Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows وLinux وMac بمعالج Intel | غير متاح بعد |-مثلًا `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` هو إصدار الإضافة،+مثلًا `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` هو إصدار الإضافة،و`macos-arm64` هو المنصة. إن اخترت الملف الخطأ، يرفض Blender تثبيته ويذكرالمنصة التي كان يتوقعها.diff --git a/docs/i18n/user-guide.de.md b/docs/i18n/user-guide.de.mdindex 3c5775f..2a88345 100644--- a/docs/i18n/user-guide.de.md+++ b/docs/i18n/user-guide.de.md@@ -29,7 +29,7 @@ und lade die Zip-Datei für deinen Computer herunter:| Mac mit Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel-Mac | Noch nicht verfügbar |-Zum Beispiel `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` ist die+Zum Beispiel `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` ist dieAdd-on-Version, `macos-arm64` die Plattform. Erwischst du die falsche Datei,verweigert Blender die Installation und nennt die erwartete Plattform.diff --git a/docs/i18n/user-guide.es-MX.md b/docs/i18n/user-guide.es-MX.mdindex 5d8b762..da1afc0 100644--- a/docs/i18n/user-guide.es-MX.md+++ b/docs/i18n/user-guide.es-MX.md@@ -29,7 +29,7 @@ y descarga el zip para tu computadora:| Mac con Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac con Intel | Todavía no disponible |-Por ejemplo, en `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` es la versión+Por ejemplo, en `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` es la versióndel complemento y `macos-arm64` la plataforma. Si eliges el equivocado, Blenderse niega a instalarlo y te dice qué plataforma esperaba.diff --git a/docs/i18n/user-guide.fil.md b/docs/i18n/user-guide.fil.mdindex c2d7359..9a4f09a 100644--- a/docs/i18n/user-guide.fil.md+++ b/docs/i18n/user-guide.fil.md@@ -29,7 +29,7 @@ at i-download ang zip para sa computer mo:| Mac na may Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel Mac | Hindi pa available |-Halimbawa, `motion2mixamorig-0.1.6-macos-arm64.zip`: ang `0.1.6` ay ang+Halimbawa, `motion2mixamorig-0.1.7-macos-arm64.zip`: ang `0.1.7` ay angbersyon ng add-on, at ang `macos-arm64` ay ang platform. Kapag mali ang napilimo, tatanggihan ito ng Blender at sasabihin kung anong platform ang inaasahan.diff --git a/docs/i18n/user-guide.fr.md b/docs/i18n/user-guide.fr.mdindex 519bd70..41783b0 100644--- a/docs/i18n/user-guide.fr.md+++ b/docs/i18n/user-guide.fr.md@@ -29,7 +29,7 @@ et téléchargez le zip correspondant à votre ordinateur :| Mac avec Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac Intel | Pas encore disponible |-Par exemple `motion2mixamorig-0.1.6-macos-arm64.zip` : `0.1.6` est la version du+Par exemple `motion2mixamorig-0.1.7-macos-arm64.zip` : `0.1.7` est la version dumodule, `macos-arm64` la plateforme. Si vous choisissez le mauvais fichier,Blender refuse de l’installer et indique la plateforme attendue.diff --git a/docs/i18n/user-guide.id.md b/docs/i18n/user-guide.id.mdindex 1f38bd0..a8f7805 100644--- a/docs/i18n/user-guide.id.md+++ b/docs/i18n/user-guide.id.md@@ -29,7 +29,7 @@ dan unduh zip untuk komputermu:| Mac dengan Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac Intel | Belum tersedia |-Contohnya `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` adalah versi+Contohnya `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` adalah versiadd-on, `macos-arm64` adalah platformnya. Kalau kamu salah pilih, Blender akanmenolak memasangnya dan menyebutkan platform yang seharusnya.diff --git a/docs/i18n/user-guide.ja.md b/docs/i18n/user-guide.ja.mdindex 4e0032a..0ca7417 100644--- a/docs/i18n/user-guide.ja.md+++ b/docs/i18n/user-guide.ja.md@@ -29,7 +29,7 @@| Apple Silicon 搭載の Mac(M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows、Linux、Intel Mac | 未対応 |-たとえば `motion2mixamorig-0.1.6-macos-arm64.zip` の場合、`0.1.6` がアドオンの+たとえば `motion2mixamorig-0.1.7-macos-arm64.zip` の場合、`0.1.7` がアドオンのバージョン、`macos-arm64` がプラットフォームです。違うものを選ぶと Blender はインストールを拒否し、想定しているプラットフォームを表示します。diff --git a/docs/i18n/user-guide.ko.md b/docs/i18n/user-guide.ko.mdindex 76c47b9..e733b36 100644--- a/docs/i18n/user-guide.ko.md+++ b/docs/i18n/user-guide.ko.md@@ -29,7 +29,7 @@| Apple Silicon Mac (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel Mac | 아직 제공되지 않음 |-예를 들어 `motion2mixamorig-0.1.6-macos-arm64.zip`에서 `0.1.6`은 애드온+예를 들어 `motion2mixamorig-0.1.7-macos-arm64.zip`에서 `0.1.7`은 애드온버전, `macos-arm64`는 플랫폼입니다. 잘못된 파일을 고르면 Blender가 설치를거부하고 필요한 플랫폼을 알려 줍니다.diff --git a/docs/i18n/user-guide.ne.md b/docs/i18n/user-guide.ne.mdindex fe2b052..8dd1295 100644--- a/docs/i18n/user-guide.ne.md+++ b/docs/i18n/user-guide.ne.md@@ -29,7 +29,7 @@| Apple Silicon (M1/M2/M3/M4) भएको Mac | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel Mac | अझै उपलब्ध छैन |-उदाहरणका लागि `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` एड-अनको संस्करण+उदाहरणका लागि `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` एड-अनको संस्करणहो, `macos-arm64` प्लेटफर्म हो। गलत फाइल छान्नुभयो भने Blender ले इन्स्टल गर्नमान्दैन र कुन प्लेटफर्म चाहिएको थियो भनेर देखाउँछ।diff --git a/docs/i18n/user-guide.nl.md b/docs/i18n/user-guide.nl.mdindex d0cc724..6ffb3bd 100644--- a/docs/i18n/user-guide.nl.md+++ b/docs/i18n/user-guide.nl.md@@ -29,7 +29,7 @@ en download de zip voor je computer:| Mac met Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel-Mac | Nog niet beschikbaar |-Bijvoorbeeld `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` is de versie van+Bijvoorbeeld `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` is de versie vande add-on, `macos-arm64` het platform. Kies je de verkeerde, dan weigert Blenderde installatie en noemt het platform dat verwacht werd.diff --git a/docs/i18n/user-guide.pl.md b/docs/i18n/user-guide.pl.mdindex d6229b4..e544911 100644--- a/docs/i18n/user-guide.pl.md+++ b/docs/i18n/user-guide.pl.md@@ -29,7 +29,7 @@ i pobierz zip dla swojego komputera:| Mac z Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac z procesorem Intel | Jeszcze niedostępne |-Na przykład w `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` to wersja+Na przykład w `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` to wersjadodatku, a `macos-arm64` to platforma. Jeśli wybierzesz zły plik, Blenderodmówi instalacji i poda, jakiej platformy oczekiwał.diff --git a/docs/i18n/user-guide.ru.md b/docs/i18n/user-guide.ru.mdindex 3ec62b1..450185e 100644--- a/docs/i18n/user-guide.ru.md+++ b/docs/i18n/user-guide.ru.md@@ -29,7 +29,7 @@| Mac с Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac с Intel | Пока недоступно |-Например, `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` — версия аддона,+Например, `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` — версия аддона,`macos-arm64` — платформа. Если выбрать не тот файл, Blender откажется егоустанавливать и назовёт ожидаемую платформу.diff --git a/docs/i18n/user-guide.th.md b/docs/i18n/user-guide.th.mdindex adc7dbd..99c973d 100644--- a/docs/i18n/user-guide.th.md+++ b/docs/i18n/user-guide.th.md@@ -29,7 +29,7 @@| Mac ที่ใช้ Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac Intel | ยังไม่มีให้ดาวน์โหลด |-ตัวอย่างเช่น `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` คือเวอร์ชันของ+ตัวอย่างเช่น `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` คือเวอร์ชันของadd-on และ `macos-arm64` คือแพลตฟอร์ม ถ้าเลือกผิดไฟล์ Blender จะไม่ยอมติดตั้งและจะบอกแพลตฟอร์มที่ต้องการdiff --git a/docs/i18n/user-guide.tr.md b/docs/i18n/user-guide.tr.mdindex 88bf878..f057c1d 100644--- a/docs/i18n/user-guide.tr.md+++ b/docs/i18n/user-guide.tr.md@@ -29,7 +29,7 @@ sayfasına gidin ve bilgisayarınıza uygun zip dosyasını indirin:| Apple Silicon'lu Mac (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel Mac | Henüz mevcut değil |-Örneğin `motion2mixamorig-0.1.6-macos-arm64.zip` dosyasında `0.1.6` eklenti+Örneğin `motion2mixamorig-0.1.7-macos-arm64.zip` dosyasında `0.1.7` eklentisürümü, `macos-arm64` ise platformdur. Yanlış dosyayı seçerseniz Blenderkurulumu reddeder ve beklediği platformu belirtir.diff --git a/docs/i18n/user-guide.vi.md b/docs/i18n/user-guide.vi.mdindex 77c6c33..fba9901 100644--- a/docs/i18n/user-guide.vi.md+++ b/docs/i18n/user-guide.vi.md@@ -29,7 +29,7 @@ và tải tệp zip phù hợp với máy của bạn:| Mac dùng Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Mac Intel | Chưa có |-Ví dụ `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` là phiên bản add-on,+Ví dụ `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` là phiên bản add-on,`macos-arm64` là nền tảng. Nếu chọn nhầm tệp, Blender sẽ từ chối cài đặt và chobiết nền tảng mà nó cần.diff --git a/docs/i18n/user-guide.zh-Hans.md b/docs/i18n/user-guide.zh-Hans.mdindex d08a69d..a1cd704 100644--- a/docs/i18n/user-guide.zh-Hans.md+++ b/docs/i18n/user-guide.zh-Hans.md@@ -28,7 +28,7 @@| Apple Silicon 芯片的 Mac(M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows、Linux、Intel Mac | 暂未提供 |-例如 `motion2mixamorig-0.1.6-macos-arm64.zip`:`0.1.6` 是插件版本,+例如 `motion2mixamorig-0.1.7-macos-arm64.zip`:`0.1.7` 是插件版本,`macos-arm64` 是平台。选错了的话,Blender 会拒绝安装,并提示它需要的平台。**不要**解压。Blender 会直接安装这个 zip。diff --git a/docs/i18n/user-guide.zh-Hant.md b/docs/i18n/user-guide.zh-Hant.mdindex fb24792..f998208 100644--- a/docs/i18n/user-guide.zh-Hant.md+++ b/docs/i18n/user-guide.zh-Hant.md@@ -28,7 +28,7 @@| 搭載 Apple Silicon 的 Mac(M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows、Linux、Intel Mac | 尚未提供 |-例如 `motion2mixamorig-0.1.6-macos-arm64.zip`:`0.1.6` 是外掛版本,+例如 `motion2mixamorig-0.1.7-macos-arm64.zip`:`0.1.7` 是外掛版本,`macos-arm64` 是平台。如果選錯了,Blender 會拒絕安裝,並告訴你它需要的平台。**不要**解壓縮。Blender 會直接安裝這個 zip。diff --git a/docs/user-guide.md b/docs/user-guide.mdindex 39782ad..8196f26 100644--- a/docs/user-guide.md+++ b/docs/user-guide.md@@ -29,7 +29,7 @@ and download the zip for your computer:| Mac with Apple Silicon (M1/M2/M3/M4) | `motion2mixamorig-<version>-macos-arm64.zip` || Windows, Linux, Intel Mac | Not available yet |-For example `motion2mixamorig-0.1.6-macos-arm64.zip`: `0.1.6` is the add-on+For example `motion2mixamorig-0.1.7-macos-arm64.zip`: `0.1.7` is the add-onversion, `macos-arm64` the platform. If you pick the wrong one, Blender refusesto install it and names the platform it expected.diff --git a/motion2mixamorig/mixamo/__init__.py b/motion2mixamorig/mixamo/__init__.pyindex 6f5d98a..a109a6b 100644--- a/motion2mixamorig/mixamo/__init__.py+++ b/motion2mixamorig/mixamo/__init__.py@@ -2,7 +2,7 @@Modules:fbx_skeleton binary FBX parser, core-bone skeleton extraction- kinematics FK with FBX PreRotation, rotation utilities+ kinematics FK from FBX bind transforms, rotation utilitiesretarget per-frame Human -> Mixamo Skeleton swing/aim retargettpose_calibration measured T-pose alignment skeleton <-> character rigybot_retarget rest-relative rotation transfer onto the full rigdiff --git a/motion2mixamorig/mixamo/fbx_skeleton.py b/motion2mixamorig/mixamo/fbx_skeleton.pyindex 2c726f9..cd9fac0 100644--- a/motion2mixamorig/mixamo/fbx_skeleton.py+++ b/motion2mixamorig/mixamo/fbx_skeleton.py@@ -1,8 +1,11 @@"""Parse a binary Mixamo FBX and extract the core skeleton.-Reads the binary FBX directly (PreRotation is a Maya/FBX property, so Assimp-cannot be used) and returns the core-bone skeleton as a plain dict — the same-structure `kinematics.rig_from_skeleton_data` consumes.+FBX files do not all encode a joint's bind orientation the same way. Mixamo's+source files commonly use ``PreRotation``; Cinema 4D exports often bake that+orientation into ``Lcl Rotation`` and may leave those Euler channels unsuitable+for reconstructing the original bind pose on their own. The bind matrices in+FBX Pose nodes and skin Cluster ``TransformLink`` records are authoritative,+so prefer them when present and fall back to local TRS for unskinned joints."""from __future__ import annotations@@ -212,6 +215,23 @@ def _child_named(node: dict[str, Any], name: str) -> dict[str, Any] | None:return None+def _mat4_fbx(values: Any) -> np.ndarray:+ """FBX stores 4x4 matrices in row-major property arrays; use column vectors."""+ return np.asarray(values, dtype=np.float64).reshape(4, 4).T+++def rotation_part(matrix: np.ndarray) -> np.ndarray:+ """Return the nearest proper rotation matrix, removing FBX scale/shear."""+ matrix = np.asarray(matrix, dtype=np.float64).reshape(3, 3)+ u, _, vt = np.linalg.svd(matrix)+ rotation = u @ vt+ if np.linalg.det(rotation) < 0.0:+ u = u.copy()+ u[:, -1] *= -1.0+ rotation = u @ vt+ return rotation++def _vec3(value: Any, default: tuple[float, float, float] = (0.0, 0.0, 0.0)) -> np.ndarray:if value is None:return np.array(default, dtype=np.float64)@@ -418,11 +438,45 @@ def extract_bind_pose(objects: dict[int, dict[str, Any]]) -> dict[int, np.ndarracontinueuid = int(node_elem["props"][0])values = matrix_elem["props"][0]- mat = np.asarray(values, dtype=np.float64).reshape(4, 4).T- poses[uid] = mat+ poses[uid] = _mat4_fbx(values)return poses+def extract_cluster_bind_transforms(+ objects: dict[int, dict[str, Any]],+ connections: list[tuple[str, int, int]],+ limbs: dict[int, dict[str, Any]],+) -> dict[int, np.ndarray]:+ """Get each linked bone's bind-world matrix from skin Cluster TransformLink.++ Cinema 4D exports may omit FBX Pose nodes, while retaining the bind matrices+ that skinning uses. When multiple meshes link to the same bone, choose the+ medoid TransformLink matrix (the closest one to all the others) to tolerate+ tiny exporter rounding differences without averaging rotation matrices.+ """+ clusters = {+ uid: obj+ for uid, obj in objects.items()+ if obj["node_name"] == "Deformer" and obj.get("class") == "Cluster"+ }+ by_bone: dict[int, list[np.ndarray]] = {}+ for kind, src, dst in connections:+ if kind != "OO" or src not in limbs or dst not in clusters:+ continue+ elem = _child_named(clusters[dst]["raw"], "TransformLink")+ if elem is None or not elem["props"]:+ continue+ matrix = _mat4_fbx(elem["props"][0])+ by_bone.setdefault(src, []).append(matrix)++ out: dict[int, np.ndarray] = {}+ for uid, matrices in by_bone.items():+ distances = [sum(float(np.linalg.norm(candidate - other)) for other in matrices)+ for candidate in matrices]+ out[uid] = matrices[int(np.argmin(distances))].copy()+ return out++def collect_limb_nodes(objects: dict[int, dict[str, Any]]) -> dict[int, dict[str, Any]]:limbs: dict[int, dict[str, Any]] = {}for uid, obj in objects.items():@@ -498,6 +552,42 @@ def compose_world(return world+def compose_rest_transforms(+ parent_of: dict[int, int | None],+ local_from_properties: dict[int, np.ndarray],+ bind_world: dict[int, np.ndarray],+) -> tuple[dict[int, np.ndarray], dict[int, np.ndarray]]:+ """Compose rest locals/worlds, preferring authoritative bind-world matrices.++ ``Pose`` matrices win over ``Cluster.TransformLink`` matrices before this+ function is called. For a joint with a bind-world matrix, derive its local+ rest matrix relative to its effective parent. This recovers the bind frame+ even when an exporter rewrites or bakes the source PreRotation channels.+ Unlinked/end-site joints fall back to their FBX local TRS values.+ """+ local_of: dict[int, np.ndarray] = {}+ world_of: dict[int, np.ndarray] = {}++ def evaluate(uid: int) -> np.ndarray:+ if uid in world_of:+ return world_of[uid]+ parent = parent_of.get(uid)+ parent_world = evaluate(parent) if parent is not None else None+ if uid in bind_world:+ world = np.asarray(bind_world[uid], dtype=np.float64).reshape(4, 4).copy()+ local = world.copy() if parent_world is None else np.linalg.solve(parent_world, world)+ else:+ local = np.asarray(local_from_properties[uid], dtype=np.float64).reshape(4, 4).copy()+ world = local.copy() if parent_world is None else parent_world @ local+ local_of[uid] = local+ world_of[uid] = world+ return world++ for uid in local_from_properties:+ evaluate(uid)+ return local_of, world_of++def unit_to_meters(settings: dict[str, Any]) -> float:"""FBX default unit is centimeters when UnitScaleFactor == 1."""scale = float(settings.get("UnitScaleFactor", 1.0) or 1.0)@@ -519,13 +609,21 @@ def extract_skeleton(fbx_path: Path) -> dict[str, Any]:limbs = collect_limb_nodes(objects)parent_of = build_hierarchy(limbs, connections)- local_of: dict[int, np.ndarray] = {}+ local_from_properties: dict[int, np.ndarray] = {}parts_of: dict[int, dict[str, np.ndarray]] = {}for uid, obj in limbs.items():local, parts = bone_local_matrix(obj["props"])- local_of[uid] = local+ local_from_properties[uid] = localparts_of[uid] = parts- world_of = compose_world(parent_of, local_of)+ cluster_bind = extract_cluster_bind_transforms(objects, connections, limbs)+ bind_world = dict(cluster_bind)+ bind_world.update(bind_pose) # FBX Pose is the highest-priority bind source.+ bind_source = {+ uid: "Pose" if uid in bind_pose else+ "Cluster.TransformLink" if uid in cluster_bind else "local TRS"+ for uid in limbs+ }+ local_of, world_of = compose_rest_transforms(parent_of, local_from_properties, bind_world)core_uids = [uid for uid, obj in limbs.items() if is_core_bone(obj["name"])]children_of: dict[int, list[int]] = {uid: [] for uid in core_uids}@@ -559,11 +657,11 @@ def extract_skeleton(fbx_path: Path) -> dict[str, Any]:parent_uid = parent_of[uid]parent_name = limbs[parent_uid]["name"] if parent_uid in limbs else Nonechild_names = [limbs[c]["name"] for c in sort_children(children_of[uid])]- bind = bind_pose.get(uid)- bind_err = None- if bind is not None:- bind_err = float(np.linalg.norm(world - bind))+ bind = bind_world.get(uid)+ bind_err = float(np.linalg.norm(world - bind)) if bind is not None else Nonepre = parts["pre_rotation_euler_deg"]+ local_rotation = rotation_part(local[:3, :3])+ world_rotation = rotation_part(world[:3, :3])bones.append({"name": obj["name"],@@ -571,25 +669,31 @@ def extract_skeleton(fbx_path: Path) -> dict[str, Any]:"children": child_names,"pre_rotation_euler_deg": _tolist(pre),"pre_rotation_matrix": _tolist(euler_xyz_deg_to_matrix(pre)),- "lcl_translation": _tolist(parts["lcl_translation"]),+ # Effective local translation can differ from the raw Lcl value+ # when an exporter has changed its bind transforms.+ "lcl_translation": _tolist(local[:3, 3]),+ "fbx_lcl_translation": _tolist(parts["lcl_translation"]),"lcl_rotation_euler_deg": _tolist(parts["lcl_rotation_euler_deg"]),"lcl_scaling": _tolist(parts["lcl_scaling"]),"post_rotation_euler_deg": _tolist(parts["post_rotation_euler_deg"]),+ "rest_rotation_matrix": _tolist(local_rotation),"rest_local": {"matrix": _tolist(local),"translation": _tolist(local[:3, 3]),- "rotation_matrix": _tolist(local[:3, :3]),- "quaternion_wxyz": _tolist(matrix_to_quat_wxyz(local[:3, :3])),+ "rotation_matrix": _tolist(local_rotation),+ "quaternion_wxyz": _tolist(matrix_to_quat_wxyz(local_rotation)),"scale": _tolist(np.array([np.linalg.norm(local[:3, i]) for i in range(3)])),},"rest_world": {"matrix": _tolist(world),"translation": _tolist(world[:3, 3]),"translation_m": _tolist(world[:3, 3] * meters_per_fbx),- "rotation_matrix": _tolist(world[:3, :3]),- "quaternion_wxyz": _tolist(matrix_to_quat_wxyz(world[:3, :3])),+ "rotation_matrix": _tolist(world_rotation),+ "quaternion_wxyz": _tolist(matrix_to_quat_wxyz(world_rotation)),},- "bind_pose_world_matrix": _tolist(bind) if bind is not None else None,+ "bind_pose_world_matrix": _tolist(bind_pose[uid]) if uid in bind_pose else None,+ "bind_world_matrix": _tolist(bind) if bind is not None else None,+ "bind_transform_source": bind_source[uid],"bind_pose_match_error": bind_err,})@@ -618,8 +722,10 @@ def extract_skeleton(fbx_path: Path) -> dict[str, Any]:"meters_per_fbx_unit": meters_per_fbx,},"transform_convention": (- "Maya/FBX: M_local = T * Roff * Rp * Rpre * R * Rpost^{-1} * Rp^{-1} * S; "- "M_world = M_parent_world * M_local. Euler XYZ in degrees, column-vector matrices."+ "Rest bind matrices prefer FBX Pose, then skin Cluster.TransformLink, then local TRS. "+ "Animation is a rest-relative delta: M_local = T_bind * R_bind * R_anim. "+ "Property fallback uses Maya/FBX T * Roff * Rp * Rpre * R * Rpost^{-1} * Rp^{-1} * S; "+ "column-vector matrices."),"root": limbs[roots[0]]["name"] if roots else None,"bone_count": len(bones),diff --git a/motion2mixamorig/mixamo/gltf.py b/motion2mixamorig/mixamo/gltf.pyindex 694cfb8..a64799d 100644--- a/motion2mixamorig/mixamo/gltf.py+++ b/motion2mixamorig/mixamo/gltf.py@@ -1,8 +1,9 @@"""Write a skinned Mixamo character + its animation as a .glb (glTF 2.0).-Blender opens this in one import: mesh, skin weights, and the clip. Node TRS-is the full local Mixamo transform `T * Rpre * R_anim` (glTF has no-PreRotation), so the importer's linear-blend skin matches this repo's.+Blender opens this in one import: mesh, skin weights, and the clip. Each joint+node stores the recovered full bind-local transform ``T_bind * R_bind``; the+animation channel stores the rest-relative delta ``R_anim``. This works whether+the source FBX kept ``PreRotation`` or baked it into another bind representation.Units are metres (Y-up). Vertex influences are the top four weights."""@@ -134,19 +135,17 @@ def write_glb(node["children"] = kidsnodes.append(node)- mesh_node = len(nodes)- nodes.append({"name": "skinned_mesh", "mesh": 0, "skin": 0})-- ibm = np.stack(- [_scale_affine(asset.meshes[0].ibm[i], scale) for i in range(n_bones)],- axis=0,- ).astype(np.float32)- # glTF stores matrices column-major.- ibm_acc = accessor(np.ascontiguousarray(ibm.transpose(0, 2, 1)), "MAT4", 5126)-- primitives = []+ # FBX skin clusters can have different inverse-bind matrices for each+ # geometry object because each mesh has its own bind-space transform. A+ # glTF skin has only one inverseBindMatrices accessor, shared by every+ # node using that skin. Keep the meshes as separate nodes/skins so that+ # each geometry preserves the per-mesh cluster matrices used by the+ # preview renderer. The joint hierarchy itself is still shared.+ mesh_nodes: list[int] = []+ meshes: list[dict] = []+ skins: list[dict] = []materials = []- for mesh in asset.meshes:+ for mesh_i, mesh in enumerate(asset.meshes):verts = (mesh.vertices * scale).astype(np.float32)faces = np.ascontiguousarray(mesh.faces, dtype=np.uint32)joints, weights = _top4_weights(mesh.weights)@@ -160,7 +159,7 @@ def write_glb("roughnessFactor": 0.7,},})- primitives.append({+ primitive = {"attributes": {"POSITION": accessor(verts, "VEC3", 5126, target=34962),"NORMAL": accessor(normals, "VEC3", 5126, target=34962),@@ -169,6 +168,32 @@ def write_glb(},"indices": accessor(faces.reshape(-1), "SCALAR", 5125, target=34963),"material": len(materials) - 1,+ }+ meshes.append({"name": mesh.name or f"character_mesh_{mesh_i}", "primitives": [primitive]})++ ibm = np.stack(+ [_scale_affine(mesh.ibm[i], scale) for i in range(n_bones)],+ axis=0,+ ).astype(np.float32)+ # glTF stores matrices column-major. This is intentionally per mesh:+ # using asset.meshes[0].ibm for every primitive breaks meshes whose+ # FBX cluster Transform differs from the first geometry's Transform.+ ibm_acc = accessor(np.ascontiguousarray(ibm.transpose(0, 2, 1)), "MAT4", 5126)+ skin_i = len(skins)+ skins.append({+ # Same name on every skin: Blender names the armature after it, and+ # earlier releases produced an armature called "mixamo".+ "name": "mixamo",+ "joints": list(range(n_bones)),+ "skeleton": bone_index[rig.root],+ "inverseBindMatrices": ibm_acc,+ })+ mesh_node = len(nodes)+ mesh_nodes.append(mesh_node)+ nodes.append({+ "name": f"skinned_mesh_{mesh_i}_{mesh.name or 'mesh'}",+ "mesh": mesh_i,+ "skin": skin_i,})n = len(r_anim_frames)@@ -206,16 +231,11 @@ def write_glb(gltf = {"asset": {"version": "2.0", "generator": "motion2mixamorig"},"scene": 0,- "scenes": [{"nodes": [bone_index[rig.root], mesh_node]}],+ "scenes": [{"nodes": [bone_index[rig.root], *mesh_nodes]}],"nodes": nodes,- "meshes": [{"name": "character", "primitives": primitives}],+ "meshes": meshes,"materials": materials,- "skins": [{- "name": "mixamo",- "joints": list(range(n_bones)),- "skeleton": bone_index[rig.root],- "inverseBindMatrices": ibm_acc,- }],+ "skins": skins,"animations": [{"name": "mixamo_clip", "samplers": samplers, "channels": channels}],"accessors": accessors,"bufferViews": views,diff --git a/motion2mixamorig/mixamo/kinematics.py b/motion2mixamorig/mixamo/kinematics.pyindex a5dcd41..18947a8 100644--- a/motion2mixamorig/mixamo/kinematics.py+++ b/motion2mixamorig/mixamo/kinematics.py@@ -1,12 +1,14 @@-"""Mixamo Y Bot FK that keeps FBX PreRotation as a separate node.+"""Mixamo FK using the source rig's full local bind orientation.-Maya/FBX (and Assimp's extra PreRotation node) compose as:+Some FBX files store bind orientation in ``PreRotation``; others (notably+Cinema 4D exports) bake it into ``Lcl Rotation`` or preserve it only in skin+bind matrices. Animation rotations in this package are deltas from that bind+orientation, so the common convention is:- M_local = T * Rpre * R_anim+ M_local = T_bind * R_bind * R_animM_world = M_parent_world * M_local-R_anim is the animated Lcl Rotation. Rpre is rest-only and is never baked-into R_anim. Bone lengths live in T (Lcl Translation) and stay constant.+The name ``pre_rotation`` remains as a compatibility alias on ``MixamoBone``."""from __future__ import annotations@@ -18,7 +20,7 @@ from typing import Any, Iterableimport numpy as np-from .fbx_skeleton import matrix_to_quat_wxyz+from .fbx_skeleton import matrix_to_quat_wxyz, rotation_partdef _as_vec3(value: Iterable[float]) -> np.ndarray:@@ -185,12 +187,17 @@ class MixamoBone:name: strparent: str | Nonechildren: list[str]- pre_rotation: np.ndarray+ rest_rotation: np.ndarraylcl_translation_cm: np.ndarrayrest_world: np.ndarrayrest_local: np.ndarraypre_rotation_euler_deg: np.ndarray+ @property+ def pre_rotation(self) -> np.ndarray:+ """Backward-compatible alias; now stores the full bind rotation."""+ return self.rest_rotation+@dataclassclass MixamoRig:@@ -213,14 +220,20 @@ def rig_from_skeleton_data(data: dict[str, Any], source: Path) -> MixamoRig:bones: dict[str, MixamoBone] = {}for raw in data["bones"]:name = str(raw["name"])+ rest_local = raw.get("rest_local", {})+ rest_rotation = rest_local.get("rotation_matrix")+ if rest_rotation is None:+ rest_rotation = raw.get("rest_rotation_matrix")+ if rest_rotation is None:+ rest_rotation = raw.get("pre_rotation_matrix", np.eye(3).tolist())bones[name] = MixamoBone(name=name,parent=raw["parent"],children=list(raw["children"]),- pre_rotation=_as_mat3(raw["pre_rotation_matrix"]),- lcl_translation_cm=_as_vec3(raw["lcl_translation"]),+ rest_rotation=rotation_part(_as_mat3(rest_rotation)),+ lcl_translation_cm=_as_vec3(raw.get("lcl_translation", rest_local.get("translation", [0, 0, 0]))),rest_world=_as_mat4(raw["rest_world"]["matrix"]),- rest_local=_as_mat4(raw["rest_local"]["matrix"]),+ rest_local=_as_mat4(rest_local["matrix"]),pre_rotation_euler_deg=_as_vec3(raw["pre_rotation_euler_deg"]),)return MixamoRig(@@ -240,9 +253,9 @@ def load_mixamo_rig(path: Path) -> MixamoRig:def local_matrix(bone: MixamoBone, r_anim: np.ndarray, translation_cm: np.ndarray | None = None) -> np.ndarray:- """Assimp-equivalent local node: T * Rpre * R_anim."""+ """Local node transform: T_bind * R_bind * rest-relative animation delta."""t = bone.lcl_translation_cm if translation_cm is None else np.asarray(translation_cm, dtype=np.float64)- return mat4(bone.pre_rotation @ r_anim, t)+ return mat4(bone.rest_rotation @ r_anim, t)def forward_kinematics(@@ -284,8 +297,8 @@ def bone_direction_world(rig: MixamoRig, world: dict[str, np.ndarray], parent: sdef anim_from_world_rotation(bone: MixamoBone, r_parent_world: np.ndarray, r_world: np.ndarray) -> np.ndarray:- """R_anim such that R_parent * Rpre * R_anim = R_world."""- return bone.pre_rotation.T @ r_parent_world.T @ r_world+ """R_anim such that R_parent * R_bind * R_anim = R_world."""+ return bone.rest_rotation.T @ r_parent_world.T @ r_worlddef swing_anim_to_direction(@@ -298,8 +311,8 @@ def swing_anim_to_direction() -> np.ndarray:"""Lcl Rotation that aims this bone's rest axis at target_dir_world.- Rest axis is the child's Lcl Translation (Mixamo local +Y) after PreRotation:- R_parent * Rpre * R_anim * d_local = d_target+ Rest axis is the child's bind-local translation after the full rest rotation:+ R_parent * R_bind * R_anim * d_local = d_target"""bone = rig.bones[bone_name]parent_r = np.eye(3) if bone.parent is None else world[bone.parent][:3, :3]@@ -307,7 +320,7 @@ def swing_anim_to_direction(if child_name is None:raise ValueError(f"{bone_name}: need child_name or d_local")d_local = rig.child_offset_cm(bone_name, child_name)- d_in_anim = bone.pre_rotation.T @ parent_r.T @ normalize(target_dir_world)+ d_in_anim = bone.rest_rotation.T @ parent_r.T @ normalize(target_dir_world)return rotation_aligning(d_local, d_in_anim)@@ -335,13 +348,13 @@ def frame_anim_from_two_vectors(Used for feet: primary = ankle→toe (forward), secondary = world up (twist)."""- r_rest_world = r_parent_world @ bone.pre_rotation+ r_rest_world = r_parent_world @ bone.rest_rotationr_rest_frame = frame_from_primary_secondary(r_rest_world @ rest_primary_local, r_rest_world @ rest_secondary_local)r_tgt_frame = frame_from_primary_secondary(tgt_primary_world, tgt_secondary_world)r_world = (r_tgt_frame @ r_rest_frame.T) @ r_rest_world- return bone.pre_rotation.T @ r_parent_world.T @ r_world+ return bone.rest_rotation.T @ r_parent_world.T @ r_worlddef frame_anim_from_axes(@@ -357,11 +370,11 @@ def frame_anim_from_axes(Used for Hips and Spine2 so clavicle attachments keep a chest twist, not afree swing around the spine."""- r_rest_world = r_parent_world @ bone.pre_rotation+ r_rest_world = r_parent_world @ bone.rest_rotationr_rest_frame = orthonormal_frame(r_rest_world @ rest_left_local, r_rest_world @ rest_up_local)r_tgt_frame = orthonormal_frame(tgt_left_world, tgt_up_world)r_world = (r_tgt_frame @ r_rest_frame.T) @ r_rest_world- return bone.pre_rotation.T @ r_parent_world.T @ r_world+ return bone.rest_rotation.T @ r_parent_world.T @ r_worlddiff --git a/motion2mixamorig/mixamo/retarget.py b/motion2mixamorig/mixamo/retarget.pyindex 9ee1a1e..475e6e9 100644--- a/motion2mixamorig/mixamo/retarget.py+++ b/motion2mixamorig/mixamo/retarget.py@@ -1,6 +1,6 @@"""Human → Mixamo per-frame retarget.-FK is T * Rpre * R_anim. Mixamo rest bone lengths are never scaled.+FK is T_bind * R_bind * R_anim. Mixamo rest bone lengths are never scaled.Optional previous-frame rotations pick the 180-degree twist closest to thelast frame and enforce quaternion sign continuity. No temporal smoothing."""@@ -95,7 +95,7 @@ SWING_TARGETS_NO_CLAVICLE = {"mixamorig:RightForeArm": ("right_elbow", "right_wrist"),}-# Child that defines this bone's rest axis (local +Y after PreRotation).+# Child that defines this bone's rest axis (local +Y after the full bind rotation).AIM_CHILD = {"mixamorig:Spine": "mixamorig:Spine1","mixamorig:Spine1": "mixamorig:Spine2",@@ -280,13 +280,13 @@ def human_dir(motion, frame: int, start: str, end: str) -> np.ndarray:def verify_rest_fk(rig: MixamoRig, atol: float = 1e-4) -> float:- """Identity R_anim must reproduce the FBX rest pose (PreRotation included)."""+ """Identity R_anim must reproduce the FBX rest pose (the full bind rotation included)."""world = forward_kinematics(rig, {})err = 0.0for name, bone in rig.bones.items():err = max(err, float(np.linalg.norm(world[name] - bone.rest_world)))if err > atol:- raise RuntimeError(f"rest FK mismatch {err:.4g} > {atol} — PreRotation composition is wrong")+ raise RuntimeError(f"rest FK mismatch {err:.4g} > {atol} — bind-rotation composition is wrong")return err@@ -371,7 +371,7 @@ def _foot_rotation(rig: MixamoRig, world: dict[str, np.ndarray], motion, frame:bone = rig.bones[foot]parent_r = world[bone.parent][:3, :3] if bone.parent else np.eye(3)along_local = rig.child_offset_cm(foot, toe)- r_rest = parent_r @ bone.pre_rotation+ r_rest = parent_r @ bone.rest_rotationup_local = r_rest.T @ WORLD_UPankle = "left_ankle" if side == "Left" else "right_ankle"foot_j = "left_foot" if side == "Left" else "right_foot"diff --git a/motion2mixamorig/mixamo/skinned_mesh.py b/motion2mixamorig/mixamo/skinned_mesh.pyindex 6ae9f73..6bcc0b7 100644--- a/motion2mixamorig/mixamo/skinned_mesh.py+++ b/motion2mixamorig/mixamo/skinned_mesh.py@@ -1,7 +1,8 @@-"""Load Mixamo character meshes + skin clusters from binary FBX.+"""Load Mixamo character meshes, bind matrices, and limbs from binary FBX.-Does not change retargeting. FK is the existing T * Rpre * R_anim chain;-finger bones stay at rest (identity R_anim) and follow the hands.+The full local bind rotation is recovered from FBX Pose / Cluster bind data+when available. Finger bones stay at rest (identity animation delta) and follow+the hands, regardless of whether the source file uses PreRotation."""from __future__ import annotations@@ -16,12 +17,14 @@ from .fbx_skeleton import (bone_local_matrix,build_hierarchy,collect_limb_nodes,- compose_world,- euler_xyz_deg_to_matrix,+ compose_rest_transforms,extract_connections,+ extract_bind_pose,+ extract_cluster_bind_transforms,extract_global_settings,extract_objects,parse_fbx,+ rotation_part,unit_to_meters,)from .kinematics import MixamoBone, MixamoRig, forward_kinematics@@ -322,6 +325,7 @@ class SkinnedMesh:ibm: np.ndarray # (B, 4, 4) inverse bind = Cluster.Transformcolor: np.ndarrayface_colors: np.ndarray | None = None # (F, 3) BGR from the diffuse map+ bind_mesh_matrix: np.ndarray = field(default_factory=lambda: np.eye(4))@dataclass@@ -336,7 +340,11 @@ class YBotAsset:def load_full_rig(fbx_path: Path) -> MixamoRig:- """Every Mixamo limb, same PreRotation local-matrix convention as the core rig."""+ """Load every limb, recovering bind orientations even when PreRotation was baked.++ FBX Pose nodes are preferred, then skin Cluster TransformLink matrices, and+ local TRS is used for end-site or otherwise unskinned bones.+ """fbx_path = Path(fbx_path)version, nodes = parse_fbx(fbx_path)objects = extract_objects(nodes)@@ -344,13 +352,15 @@ def load_full_rig(fbx_path: Path) -> MixamoRig:settings = extract_global_settings(nodes)limbs = collect_limb_nodes(objects)parent_of = build_hierarchy(limbs, connections)- local_of: dict[int, np.ndarray] = {}+ local_from_properties: dict[int, np.ndarray] = {}parts_of: dict[int, dict[str, np.ndarray]] = {}for uid, obj in limbs.items():local, parts = bone_local_matrix(obj["props"])- local_of[uid] = local+ local_from_properties[uid] = localparts_of[uid] = parts- world_of = compose_world(parent_of, local_of)+ bind_world = extract_cluster_bind_transforms(objects, connections, limbs)+ bind_world.update(extract_bind_pose(objects))+ local_of, world_of = compose_rest_transforms(parent_of, local_from_properties, bind_world)children_of: dict[int, list[int]] = {uid: [] for uid in limbs}for uid, parent in parent_of.items():@@ -380,8 +390,8 @@ def load_full_rig(fbx_path: Path) -> MixamoRig:name=name,parent=parent_name,children=child_names,- pre_rotation=euler_xyz_deg_to_matrix(parts["pre_rotation_euler_deg"]),- lcl_translation_cm=parts["lcl_translation"].copy(),+ rest_rotation=rotation_part(local_of[uid][:3, :3]),+ lcl_translation_cm=local_of[uid][:3, 3].copy(),rest_world=world_of[uid],rest_local=local_of[uid],pre_rotation_euler_deg=parts["pre_rotation_euler_deg"].copy(),@@ -458,6 +468,7 @@ def load_character_asset(n_verts = vertices.shape[0]weights = np.zeros((n_verts, n_bones), dtype=np.float64)ibm = np.repeat(np.eye(4)[None, ...], n_bones, axis=0)+ bind_mesh_matrix: np.ndarray | None = Nonefor cluster_uid, skin_uid in cluster_to_skin.items():if skin_to_geom.get(skin_uid) != geom_uid:continue@@ -471,9 +482,18 @@ def load_character_asset(idx_elem = _child_named(cluster["raw"], "Indexes")w_elem = _child_named(cluster["raw"], "Weights")t_elem = _child_named(cluster["raw"], "Transform")+ tl_elem = _child_named(cluster["raw"], "TransformLink")b = bone_index[bone_name]if t_elem is not None and t_elem["props"]:ibm[b] = _mat4_fbx(t_elem["props"][0])+ if tl_elem is not None and tl_elem["props"]:+ # Cluster.Transform is the inverse-bind relation from the+ # linked joint to this mesh's bind transform. The product+ # reconstructs the mesh transform that must be baked into+ # the skin palette because the GLB mesh node is identity.+ candidate = _mat4_fbx(tl_elem["props"][0]) @ ibm[b]+ if bind_mesh_matrix is None:+ bind_mesh_matrix = candidateif idx_elem is None or w_elem is None:continueindexes = np.asarray(idx_elem["props"][0], dtype=np.int64)@@ -491,6 +511,7 @@ def load_character_asset(ibm=ibm,color=colors.get(_fbx_name(geom["name"]), np.array([0.6, 0.6, 0.6])),face_colors=tinted,+ bind_mesh_matrix=(bind_mesh_matrix if bind_mesh_matrix is not None else np.eye(4)),))return YBotAsset(rig=rig, meshes=meshes, bone_index=bone_index)@@ -534,10 +555,22 @@ def posed_vertices(def rest_skin_error(asset: YBotAsset) -> float:- """Identity R_anim must reproduce bind vertices (PreRotation FK + IBM)."""+ """Maximum rest-skin error against vertices transformed into rig space.++ FBX Geometry vertices are mesh-local. The mesh Model transform is encoded+ in the skin palette (Cluster.Transform / TransformLink), not as a separate+ GLB mesh-node transform, so comparing posed vertices directly to the raw+ geometry array would report a false error.+ """world = forward_kinematics(asset.rig, {})err = 0.0for mesh in asset.meshes:posed = skin_mesh(mesh, bone_palette(world, mesh, asset.rig.order))- err = max(err, float(np.linalg.norm(posed - mesh.vertices, axis=1).max()))+ vertices_h = np.concatenate(+ [mesh.vertices, np.ones((mesh.vertices.shape[0], 1), dtype=np.float64)], axis=1+ )+ expected = (vertices_h @ mesh.bind_mesh_matrix.T)[:, :3]+ weighted = mesh.weights.sum(axis=1) > 1e-8+ if np.any(weighted):+ err = max(err, float(np.linalg.norm(posed[weighted] - expected[weighted], axis=1).max()))return errdiff --git a/motion2mixamorig/mixamo/tpose_calibration.py b/motion2mixamorig/mixamo/tpose_calibration.pyindex 44ea203..93e9cb0 100644--- a/motion2mixamorig/mixamo/tpose_calibration.py+++ b/motion2mixamorig/mixamo/tpose_calibration.py@@ -170,9 +170,10 @@ def canonical_mixamo_tpose(rig: MixamoRig) -> dict[str, np.ndarray]:def rig_rest_from_skeleton_data(data: dict, fbx_path: Path) -> tuple[dict[str, np.ndarray], dict]:"""Core Mixamo bones from the character FBX rest pose.- PreRotation is already inside the local matrix. Assimp- `$AssimpFbx$_PreRotation` helpers are not anatomical bones; extract_skeleton- applies Maya/FBX `T * Rpre * R * ...` so those extra nodes are not listed.+ The full FBX bind transform is already represented in the extracted local+ and world matrices. Assimp `$AssimpFbx$_PreRotation` helper nodes are not+ anatomical bones; extract_skeleton resolves bind matrices directly, so+ those extra nodes are not listed."""pos: dict[str, np.ndarray] = {}for bone in data["bones"]:diff --git a/motion2mixamorig/mixamo/ybot_retarget.py b/motion2mixamorig/mixamo/ybot_retarget.pyindex 63c9aca..4be7af2 100644--- a/motion2mixamorig/mixamo/ybot_retarget.py+++ b/motion2mixamorig/mixamo/ybot_retarget.py@@ -68,9 +68,9 @@ CONTROLLED_BONES = (def rest_world_rotations(rig: MixamoRig) -> dict[str, np.ndarray]:"""World rotation of each bone's rest frame.- FK is `M_local = T * Rpre * R_anim`, so at rest (`R_anim = I`) the bone's- world rotation is `R_parent_world @ Rpre`. PreRotation therefore stays part- of the rest transform and is never folded into the animation channel.+ FK is `M_local = T_bind * R_bind * R_anim`, so at rest (`R_anim = I`) the+ bone's world rotation is `R_parent_world @ R_bind`. The full bind rotation+ stays in the node transform and is never folded into the animation channel."""world = forward_kinematics(rig, {})return {name: np.asarray(mat[:3, :3], dtype=np.float64) for name, mat in world.items()}@@ -119,7 +119,7 @@ class YBotMapping:"""Transfer one frame of rest-relative local rotations onto the Y Bot rig.Input and output are both animation-channel rotations, i.e. the `R_anim`- of `M_local = T * Rpre * R_anim`. Bones the Mixamo retarget does not+ of `M_local = T_bind * R_bind * R_anim`. Bones the Mixamo retarget does notauthor (the finger chains) are left at rest."""out: dict[str, np.ndarray] = {}diff --git a/motion2mixamorig/pipeline.py b/motion2mixamorig/pipeline.pyindex 09a5a86..eecd82a 100644--- a/motion2mixamorig/pipeline.py+++ b/motion2mixamorig/pipeline.py@@ -35,8 +35,9 @@ from .run_report import write_failed_report, write_run_jsonfrom .videos import render_run_images, render_run_videosROTATION_CONVENTION = (- "Animation-channel rotations: M_local = T * Rpre * R_anim, world = parent @ local. "- "Quaternions are wxyz. FBX rest translations (T, Rpre) come from the rig file."+ "Animation-channel rotations are rest-relative deltas: M_local = T_bind * R_bind * R_anim, "+ "world = parent @ local. Quaternions are wxyz. Bind transforms prefer FBX Pose / "+ "Cluster.TransformLink matrices, then fall back to local TRS.")diff --git a/pyproject.toml b/pyproject.tomlindex 87f22c6..8359a53 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,6 +1,6 @@[project]name = "motion2mixamorig"-version = "0.1.6"+version = "0.1.7"description = "Retarget human motion from video or a still pose to an Adobe Mixamo-rigged 3D character."requires-python = ">=3.11"dependencies = [diff --git a/scripts/package_blender_extension.py b/scripts/package_blender_extension.pyindex b727262..02141e1 100644--- a/scripts/package_blender_extension.py+++ b/scripts/package_blender_extension.py@@ -61,7 +61,7 @@ def read_manifest(path: Path) -> dict[str, str]:def extension_version(src: Path = SRC) -> str:manifest = read_manifest(src / "blender_manifest.toml")- return manifest.get("version", "0.1.6")+ return manifest.get("version", "0.1.7")def should_include(path: Path) -> bool: