Skip to content

Commit

Permalink
feat: support VRM 1.0 models and improve bone mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoskript committed Jun 16, 2024
1 parent cd00b1f commit cf6f9a5
Show file tree
Hide file tree
Showing 17 changed files with 334 additions and 445 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.DS_Store
/vrm_rigify.zip
/.pdm-python
/.venv
11 changes: 0 additions & 11 deletions Pipfile

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ Generate Blender Rigify armatures for VRM models.

## Notice

This addon has been tested with [VRoid's sample avatars](https://vroid.pixiv.help/hc/en-us/articles/4402394424089) and
only supports the VRM 0.x format.
The latest version of this addon has been developed with:

- Blender version 4.1.1
- VRM Add-on for Blender version 2.20.54

and supports both the VRM 0.x and 1.0 format. This addon has been tested using
[VRoid's sample avatars](https://vroid.pixiv.help/hc/en-us/articles/4402394424089).

## Installation

Expand Down
Binary file modified docs/generate_rig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rm -f vrm_rigify.zip
zip vrm_rigify.zip ./vrm_rigify/*.py ./LICENSE.md
zip vrm_rigify.zip ./vrm_rigify/__init__.py ./LICENSE.md
18 changes: 18 additions & 0 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
dependencies = [
"fake-bpy-module-4-1>=20240604",
]
requires-python = ">=3.11,<3.12"

3 changes: 3 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VRM_TEST_MODEL_PATH="$1" \
BLENDER_VRM_AUTOMATIC_LICENSE_CONFIRMATION=true \
blender --python "../vrm_rigify/__init__.py" --python "./test_harness.py"
13 changes: 13 additions & 0 deletions tests/test_harness.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import bpy

# Import VRM model and generate rig.
bpy.ops.import_scene.vrm(filepath=os.environ["VRM_TEST_MODEL_PATH"])
bpy.context.view_layer.objects.active = bpy.data.objects["Armature"]
bpy.data.objects.remove(bpy.data.objects["Cube"])
bpy.ops.vrm_rigify.create_rig()

# Parent meshes to generated rig.
for mesh in bpy.data.objects["Armature"].children:
if mesh.type == "MESH":
mesh.modifiers["Armature"].object = bpy.data.objects["Armature.rig"]
Loading

0 comments on commit cf6f9a5

Please sign in to comment.