bpy-vrm-format 4.7.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. bpy_vrm_format-4.7.4/PKG-INFO +118 -0
  2. bpy_vrm_format-4.7.4/pypi.md +105 -0
  3. bpy_vrm_format-4.7.4/pyproject.toml +185 -0
  4. bpy_vrm_format-4.7.4/pyproject.toml.orig +207 -0
  5. bpy_vrm_format-4.7.4/src/io_scene_vrm/README.txt +3 -0
  6. bpy_vrm_format-4.7.4/src/io_scene_vrm/__init__.py +41 -0
  7. bpy_vrm_format-4.7.4/src/io_scene_vrm/blender_manifest.toml +28 -0
  8. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/__init__.py +1 -0
  9. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/animation.py +58 -0
  10. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/blender_manifest.py +82 -0
  11. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/char.py +16 -0
  12. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/convert.py +287 -0
  13. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/convert_any.py +48 -0
  14. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/debug.py +40 -0
  15. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/deep.py +162 -0
  16. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/error_dialog.py +274 -0
  17. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/fs.py +71 -0
  18. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/gl.py +20 -0
  19. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/gltf.py +1121 -0
  20. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/__init__.py +1 -0
  21. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/biped_mapping.py +84 -0
  22. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/cats_blender_plugin_fix_model_mapping.py +63 -0
  23. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/human_bone_mapper.py +203 -0
  24. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/microsoft_rocketbox_mapping.py +69 -0
  25. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/mixamo_mapping.py +62 -0
  26. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/mmd_mapping.py +115 -0
  27. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/mpfb_mapping.py +120 -0
  28. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/ready_player_me_mapping.py +65 -0
  29. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/reallusion_mapping.py +94 -0
  30. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/rigify_meta_rig_mapping.py +65 -0
  31. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/structure_based_mapping.py +891 -0
  32. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/unreal_mapping.py +62 -0
  33. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/vrm_addon_mapping.py +112 -0
  34. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/human_bone_mapper/vroid_mapping.py +89 -0
  35. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/legacy_gltf.py +16 -0
  36. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/logger.py +84 -0
  37. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/mtoon0.blend +0 -0
  38. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/mtoon1.blend +0 -0
  39. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/mtoon1_outline.blend +0 -0
  40. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/mtoon_auto_setup.blend +0 -0
  41. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/mtoon_unversioned.py +62 -0
  42. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/__init__.py +10 -0
  43. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/export_scene.py +67 -0
  44. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/icyp.py +53 -0
  45. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/import_scene.py +57 -0
  46. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/vrm.py +2380 -0
  47. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/ops/wm.py +167 -0
  48. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/preferences.py +362 -0
  49. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/progress.py +87 -0
  50. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/rotation.py +89 -0
  51. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/safe_removal.py +46 -0
  52. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/scene_watcher.py +230 -0
  53. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shader.py +2243 -0
  54. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shape_key_mapper/__init__.py +1 -0
  55. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shape_key_mapper/arkit_mapping.py +168 -0
  56. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shape_key_mapper/mmd_mapping.py +62 -0
  57. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shape_key_mapper/ready_player_me_mapping.py +52 -0
  58. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/shape_key_mapper/vrchat_mapping.py +17 -0
  59. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/third_party_user_extension.py +214 -0
  60. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/transparent_z_write.blend +0 -0
  61. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/version.py +161 -0
  62. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm0/__init__.py +1 -0
  63. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm0/human_bone.py +662 -0
  64. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm0/material_property.py +346 -0
  65. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm1/__init__.py +1 -0
  66. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm1/expression_preset.py +207 -0
  67. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/vrm1/human_bone.py +822 -0
  68. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/workspace.py +227 -0
  69. bpy_vrm_format-4.7.4/src/io_scene_vrm/common/writable_context.py +77 -0
  70. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/__init__.py +1 -0
  71. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/extension.py +425 -0
  72. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/extension_accessor.py +75 -0
  73. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/handler.py +84 -0
  74. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_character/__init__.py +1 -0
  75. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_character/panel.py +69 -0
  76. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_character/property_group.py +27 -0
  77. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_xmp_json_ld/__init__.py +1 -0
  78. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_xmp_json_ld/ops.py +464 -0
  79. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_xmp_json_ld/panel.py +136 -0
  80. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_xmp_json_ld/property_group.py +83 -0
  81. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/khr_xmp_json_ld/ui_list.py +198 -0
  82. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/make_armature.py +709 -0
  83. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/menu.py +147 -0
  84. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/migration.py +297 -0
  85. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/__init__.py +1 -0
  86. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/handler.py +20 -0
  87. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/migration.py +536 -0
  88. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/ops.py +304 -0
  89. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/panel.py +442 -0
  90. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/property_group.py +4977 -0
  91. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/mtoon1/scene_watcher.py +381 -0
  92. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/node_constraint1/__init__.py +1 -0
  93. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/node_constraint1/panel.py +317 -0
  94. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/node_constraint1/property_group.py +25 -0
  95. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/ops.py +471 -0
  96. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/panel.py +315 -0
  97. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/property_group.py +888 -0
  98. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/search.py +682 -0
  99. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/__init__.py +1 -0
  100. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/handler.py +862 -0
  101. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/menu.py +246 -0
  102. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/migration.py +86 -0
  103. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/ops.py +1663 -0
  104. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/panel.py +584 -0
  105. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/property_group.py +1355 -0
  106. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/spring_bone1/ui_list.py +408 -0
  107. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/subscription.py +123 -0
  108. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/t_pose.py +713 -0
  109. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/validation.py +1271 -0
  110. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/__init__.py +1 -0
  111. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/gizmo_group.py +63 -0
  112. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/handler.py +23 -0
  113. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/menu.py +145 -0
  114. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/migration.py +761 -0
  115. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/ops.py +2145 -0
  116. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/panel.py +1333 -0
  117. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/property_group.py +1818 -0
  118. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm0/ui_list.py +688 -0
  119. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/__init__.py +1 -0
  120. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/handler.py +28 -0
  121. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/menu.py +76 -0
  122. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/migration.py +321 -0
  123. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/ops.py +2679 -0
  124. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/panel.py +1243 -0
  125. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/property_group.py +2087 -0
  126. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/scene_watcher.py +90 -0
  127. bpy_vrm_format-4.7.4/src/io_scene_vrm/editor/vrm1/ui_list.py +533 -0
  128. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/__init__.py +1 -0
  129. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/abstract_base_vrm_exporter.py +628 -0
  130. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/export_scene.py +930 -0
  131. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/gltf2_export_user_extension.py +45 -0
  132. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/khr_character_exporter.py +34 -0
  133. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/vrm0_exporter.py +4030 -0
  134. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/vrm1_exporter.py +3653 -0
  135. bpy_vrm_format-4.7.4/src/io_scene_vrm/exporter/vrm_animation_exporter.py +1035 -0
  136. bpy_vrm_format-4.7.4/src/io_scene_vrm/external/__init__.py +1 -0
  137. bpy_vrm_format-4.7.4/src/io_scene_vrm/external/auto_rig_pro_support.py +3 -0
  138. bpy_vrm_format-4.7.4/src/io_scene_vrm/external/io_scene_gltf2_support.py +418 -0
  139. bpy_vrm_format-4.7.4/src/io_scene_vrm/external/rigify_support.py +1 -0
  140. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/__init__.py +1 -0
  141. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/abstract_base_vrm_importer.py +1494 -0
  142. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/file_handler.py +34 -0
  143. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/gltf2_import_user_extension.py +268 -0
  144. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/import_scene.py +646 -0
  145. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/license_validation.py +198 -0
  146. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/vrm0_importer.py +1730 -0
  147. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/vrm1_importer.py +1924 -0
  148. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/vrm_animation_importer.py +763 -0
  149. bpy_vrm_format-4.7.4/src/io_scene_vrm/importer/vrm_diff.py +316 -0
  150. bpy_vrm_format-4.7.4/src/io_scene_vrm/locale/__init__.py +1 -0
  151. bpy_vrm_format-4.7.4/src/io_scene_vrm/locale/ja_jp.py +826 -0
  152. bpy_vrm_format-4.7.4/src/io_scene_vrm/locale/ruff.toml +8 -0
  153. bpy_vrm_format-4.7.4/src/io_scene_vrm/locale/translation_dictionary.py +10 -0
  154. bpy_vrm_format-4.7.4/src/io_scene_vrm/locale/zh_hans.py +928 -0
  155. bpy_vrm_format-4.7.4/src/io_scene_vrm/registration.py +669 -0
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.3
2
+ Name: bpy-vrm-format
3
+ Version: 4.7.4
4
+ Summary: VRM import, export, and editing capabilities
5
+ Author: Isamu Mogi, iCyP
6
+ License: SPDX-License-Identifier: MIT OR GPL-3.0-or-later
7
+ Requires-Dist: bpy==3.6.* ; python_full_version == '3.10.*' and platform_machine == 'AMD64' and sys_platform == 'win32'
8
+ Requires-Dist: bpy==3.6.* ; python_full_version == '3.10.*' and platform_machine == 'arm64' and sys_platform == 'darwin'
9
+ Requires-Dist: bpy==3.6.* ; python_full_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'darwin'
10
+ Requires-Dist: bpy==3.6.* ; python_full_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'linux'
11
+ Requires-Python: ==3.10.*
12
+ Description-Content-Type: text/markdown
13
+
14
+ # VRM Add-on for Blender [![CI status](https://github.com/saturday06/VRM-Addon-for-Blender/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/saturday06/VRM-Addon-for-Blender/actions) [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/saturday06/VRM-Addon-for-Blender?utm_source=badge)
15
+
16
+ VRM Add-on for Blender adds VRM import, export, and editing capabilities to
17
+ Blender.
18
+
19
+ ## Sample Code for Generating VRM Files
20
+
21
+ Here is a sample code that generates the following 3D character model and saves
22
+ it as a `.vrm` file.
23
+
24
+ ![vrm preview](https://raw.githubusercontent.com/saturday06/VRM-Addon-for-Blender/refs/heads/main/docs/assets/images/humanoid.gif)
25
+
26
+ Before running the script, please run commands such as
27
+ `pip install bpy-vrm-format` or `uv add bpy-vrm-format` to make the package
28
+ available.
29
+
30
+ ```python
31
+ import bpy
32
+ from pathlib import Path
33
+
34
+ bpy.ops.preferences.addon_enable(module="io_scene_vrm")
35
+
36
+ bpy.ops.icyp.make_basic_armature()
37
+
38
+ context = bpy.context
39
+
40
+ armature = context.active_object
41
+ armature.data.vrm_addon_extension.spec_version = "1.0"
42
+
43
+ meta = armature.data.vrm_addon_extension.vrm1.meta
44
+ meta.vrm_name = "Your Model Name"
45
+ meta.version = "1.0.0"
46
+
47
+ humanoid = armature.data.vrm_addon_extension.vrm1.humanoid
48
+
49
+ bpy.ops.mesh.primitive_uv_sphere_add(radius=0.25)
50
+ head = context.active_object
51
+ head.parent = armature
52
+ head.parent_bone = humanoid.human_bones.head.node.bone_name
53
+ head.parent_type = "BONE"
54
+
55
+ bpy.ops.mesh.primitive_cube_add(size=0.4)
56
+ spine = context.active_object
57
+ spine.parent = armature
58
+ spine.parent_bone = humanoid.human_bones.spine.node.bone_name
59
+ spine.parent_type = "BONE"
60
+
61
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
62
+ left_upper_arm = context.active_object
63
+ left_upper_arm.parent = armature
64
+ left_upper_arm.parent_bone = humanoid.human_bones.left_upper_arm.node.bone_name
65
+ left_upper_arm.parent_type = "BONE"
66
+
67
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
68
+ left_hand = context.active_object
69
+ left_hand.parent = armature
70
+ left_hand.parent_bone = humanoid.human_bones.left_hand.node.bone_name
71
+ left_hand.parent_type = "BONE"
72
+
73
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
74
+ right_upper_arm = context.active_object
75
+ right_upper_arm.parent = armature
76
+ right_upper_arm.parent_bone = humanoid.human_bones.right_upper_arm.node.bone_name
77
+ right_upper_arm.parent_type = "BONE"
78
+
79
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
80
+ right_hand = context.active_object
81
+ right_hand.parent = armature
82
+ right_hand.parent_bone = humanoid.human_bones.right_hand.node.bone_name
83
+ right_hand.parent_type = "BONE"
84
+
85
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
86
+ left_upper_leg = context.active_object
87
+ left_upper_leg.parent = armature
88
+ left_upper_leg.parent_bone = humanoid.human_bones.left_upper_leg.node.bone_name
89
+ left_upper_leg.parent_type = "BONE"
90
+
91
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
92
+ right_upper_leg = context.active_object
93
+ right_upper_leg.parent = armature
94
+ right_upper_leg.parent_bone = humanoid.human_bones.right_upper_leg.node.bone_name
95
+ right_upper_leg.parent_type = "BONE"
96
+
97
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
98
+ left_lower_leg = context.active_object
99
+ left_lower_leg.parent = armature
100
+ left_lower_leg.parent_bone = humanoid.human_bones.left_lower_leg.node.bone_name
101
+ left_lower_leg.parent_type = "BONE"
102
+
103
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
104
+ right_lower_leg = context.active_object
105
+ right_lower_leg.parent = armature
106
+ right_lower_leg.parent_bone = humanoid.human_bones.right_lower_leg.node.bone_name
107
+ right_lower_leg.parent_type = "BONE"
108
+
109
+ output_filepath = str(Path(__file__).parent / "path_to_your_vrm_model.vrm")
110
+ result = bpy.ops.export_scene.vrm(filepath=output_filepath)
111
+ if result != {"FINISHED"}:
112
+ raise Exception(f"Failed to export vrm: {result}")
113
+
114
+ print(f"{output_filepath=}")
115
+ ```
116
+
117
+ For more information, visit
118
+ [https://vrm-addon-for-blender.info/scripting-api/](https://vrm-addon-for-blender.info/scripting-api/).
@@ -0,0 +1,105 @@
1
+ # VRM Add-on for Blender [![CI status](https://github.com/saturday06/VRM-Addon-for-Blender/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/saturday06/VRM-Addon-for-Blender/actions) [![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/saturday06/VRM-Addon-for-Blender?utm_source=badge)
2
+
3
+ VRM Add-on for Blender adds VRM import, export, and editing capabilities to
4
+ Blender.
5
+
6
+ ## Sample Code for Generating VRM Files
7
+
8
+ Here is a sample code that generates the following 3D character model and saves
9
+ it as a `.vrm` file.
10
+
11
+ ![vrm preview](https://raw.githubusercontent.com/saturday06/VRM-Addon-for-Blender/refs/heads/main/docs/assets/images/humanoid.gif)
12
+
13
+ Before running the script, please run commands such as
14
+ `pip install bpy-vrm-format` or `uv add bpy-vrm-format` to make the package
15
+ available.
16
+
17
+ ```python
18
+ import bpy
19
+ from pathlib import Path
20
+
21
+ bpy.ops.preferences.addon_enable(module="io_scene_vrm")
22
+
23
+ bpy.ops.icyp.make_basic_armature()
24
+
25
+ context = bpy.context
26
+
27
+ armature = context.active_object
28
+ armature.data.vrm_addon_extension.spec_version = "1.0"
29
+
30
+ meta = armature.data.vrm_addon_extension.vrm1.meta
31
+ meta.vrm_name = "Your Model Name"
32
+ meta.version = "1.0.0"
33
+
34
+ humanoid = armature.data.vrm_addon_extension.vrm1.humanoid
35
+
36
+ bpy.ops.mesh.primitive_uv_sphere_add(radius=0.25)
37
+ head = context.active_object
38
+ head.parent = armature
39
+ head.parent_bone = humanoid.human_bones.head.node.bone_name
40
+ head.parent_type = "BONE"
41
+
42
+ bpy.ops.mesh.primitive_cube_add(size=0.4)
43
+ spine = context.active_object
44
+ spine.parent = armature
45
+ spine.parent_bone = humanoid.human_bones.spine.node.bone_name
46
+ spine.parent_type = "BONE"
47
+
48
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
49
+ left_upper_arm = context.active_object
50
+ left_upper_arm.parent = armature
51
+ left_upper_arm.parent_bone = humanoid.human_bones.left_upper_arm.node.bone_name
52
+ left_upper_arm.parent_type = "BONE"
53
+
54
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
55
+ left_hand = context.active_object
56
+ left_hand.parent = armature
57
+ left_hand.parent_bone = humanoid.human_bones.left_hand.node.bone_name
58
+ left_hand.parent_type = "BONE"
59
+
60
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
61
+ right_upper_arm = context.active_object
62
+ right_upper_arm.parent = armature
63
+ right_upper_arm.parent_bone = humanoid.human_bones.right_upper_arm.node.bone_name
64
+ right_upper_arm.parent_type = "BONE"
65
+
66
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
67
+ right_hand = context.active_object
68
+ right_hand.parent = armature
69
+ right_hand.parent_bone = humanoid.human_bones.right_hand.node.bone_name
70
+ right_hand.parent_type = "BONE"
71
+
72
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
73
+ left_upper_leg = context.active_object
74
+ left_upper_leg.parent = armature
75
+ left_upper_leg.parent_bone = humanoid.human_bones.left_upper_leg.node.bone_name
76
+ left_upper_leg.parent_type = "BONE"
77
+
78
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
79
+ right_upper_leg = context.active_object
80
+ right_upper_leg.parent = armature
81
+ right_upper_leg.parent_bone = humanoid.human_bones.right_upper_leg.node.bone_name
82
+ right_upper_leg.parent_type = "BONE"
83
+
84
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
85
+ left_lower_leg = context.active_object
86
+ left_lower_leg.parent = armature
87
+ left_lower_leg.parent_bone = humanoid.human_bones.left_lower_leg.node.bone_name
88
+ left_lower_leg.parent_type = "BONE"
89
+
90
+ bpy.ops.mesh.primitive_ico_sphere_add(radius=0.1)
91
+ right_lower_leg = context.active_object
92
+ right_lower_leg.parent = armature
93
+ right_lower_leg.parent_bone = humanoid.human_bones.right_lower_leg.node.bone_name
94
+ right_lower_leg.parent_type = "BONE"
95
+
96
+ output_filepath = str(Path(__file__).parent / "path_to_your_vrm_model.vrm")
97
+ result = bpy.ops.export_scene.vrm(filepath=output_filepath)
98
+ if result != {"FINISHED"}:
99
+ raise Exception(f"Failed to export vrm: {result}")
100
+
101
+ print(f"{output_filepath=}")
102
+ ```
103
+
104
+ For more information, visit
105
+ [https://vrm-addon-for-blender.info/scripting-api/](https://vrm-addon-for-blender.info/scripting-api/).
@@ -0,0 +1,185 @@
1
+ [project]
2
+ name = "bpy-vrm-format"
3
+ version = "4.7.4"
4
+ description = "VRM import, export, and editing capabilities"
5
+ readme = "pypi.md"
6
+ requires-python = "==3.10.*"
7
+ dependencies = [
8
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'AMD64' and sys_platform == 'win32'",
9
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'arm64' and sys_platform == 'darwin'",
10
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'darwin'",
11
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'linux'",
12
+ ]
13
+
14
+ [[project.authors]]
15
+ name = "Isamu Mogi"
16
+
17
+ [[project.authors]]
18
+ name = "iCyP"
19
+
20
+ [project.license]
21
+ text = "SPDX-License-Identifier: MIT OR GPL-3.0-or-later"
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "bpy-vrm-format-benchmarks",
26
+ "codespell",
27
+ "pygit2",
28
+ "requests",
29
+ "ruff",
30
+ "starry-bpy-typings",
31
+ "tombi",
32
+ "tomli",
33
+ "tqdm",
34
+ "types-pygit2",
35
+ "types-tqdm",
36
+ ]
37
+
38
+ [build-system]
39
+ requires = ["uv_build>=0.12.1,<0.13.0"]
40
+ build-backend = "uv_build"
41
+
42
+ [tool.black]
43
+ extend-exclude = ".*"
44
+
45
+ [tool.codespell]
46
+ skip = "*.lock,*.asset,node_modules,./tests/resources/unity/*/Library/*,./tests/resources/unity/*/Build/*"
47
+
48
+ [tool.isort]
49
+ extend_skip_glob = ["*"]
50
+
51
+ [tool.mypy]
52
+ exclude = ["."]
53
+ ignore_errors = true
54
+
55
+ [tool.pylint.main]
56
+ ignore-paths = "."
57
+
58
+ [tool.pyright]
59
+ pythonVersion = "3.9"
60
+ pythonPlatform = "All"
61
+ typeCheckingMode = "strict"
62
+ stubPath = "typings/src"
63
+ exclude = [
64
+ "tests/resources/unity",
65
+ "**/.venv",
66
+ "**/node_modules",
67
+ "**/__pycache__",
68
+ "**/.*",
69
+ ]
70
+ reportMissingModuleSource = false
71
+ reportCallInDefaultInitializer = true
72
+ reportUninitializedInstanceVariable = true
73
+
74
+ [[tool.pyright.executionEnvironments]]
75
+ root = "tests"
76
+ extraPaths = [
77
+ "src",
78
+ "typings/src",
79
+ ".",
80
+ ]
81
+ reportPrivateUsage = "none"
82
+
83
+ [tool.ruff]
84
+ target-version = "py39"
85
+ src = [
86
+ "typings/src",
87
+ "src",
88
+ ]
89
+
90
+ [tool.ruff.lint]
91
+ select = ["ALL"]
92
+ ignore = [
93
+ "CPY001",
94
+ "FBT003",
95
+ "COM812",
96
+ "D100",
97
+ "D101",
98
+ "D102",
99
+ "D103",
100
+ "D104",
101
+ "D105",
102
+ "D106",
103
+ "D107",
104
+ "ERA001",
105
+ "EXE002",
106
+ "FA100",
107
+ "FIX002",
108
+ "ISC001",
109
+ "ISC003",
110
+ "PERF203",
111
+ "PLC0415",
112
+ "PLR2004",
113
+ "PT",
114
+ "RET504",
115
+ "SIM118",
116
+ "TC001",
117
+ "TC002",
118
+ "TC003",
119
+ "TD002",
120
+ "TD003",
121
+ "TID252",
122
+ ]
123
+
124
+ [tool.ruff.lint.per-file-ignores]
125
+ "examples/**/*.py" = ["ARG002"]
126
+ "tests/**/*.py" = [
127
+ "S603",
128
+ "S607",
129
+ "SLF001",
130
+ ]
131
+
132
+ [tool.ruff.lint.pep8-naming]
133
+ extend-ignore-names = [
134
+ "glTF2ExportUserExtension",
135
+ "glTF2ImportUserExtension",
136
+ "EXPORT_SCENE_OT_*",
137
+ "IMPORT_SCENE_OT_*",
138
+ "ICYP_OT_*",
139
+ "VRM_FH_*",
140
+ "VRM_MT_*",
141
+ "VRM_OT_*",
142
+ "VRM_PT_*",
143
+ "VRM_UL_*",
144
+ "WM_OT_*",
145
+ ]
146
+
147
+ [tool.ruff.lint.pydocstyle]
148
+ convention = "pep257"
149
+
150
+ [tool.ruff.lint.mccabe]
151
+ max-complexity = 216
152
+
153
+ [tool.ruff.lint.pylint]
154
+ max-args = 19
155
+ max-branches = 215
156
+ max-returns = 31
157
+ max-statements = 550
158
+
159
+ [tool.ruff.lint.flake8-tidy-imports.banned-api."unittest.mock"]
160
+ msg = "Please use actual objects or DI"
161
+
162
+ [tool.uv]
163
+ cache-dir = "./.local/var/cache/uv"
164
+
165
+ [tool.uv.workspace]
166
+ members = [
167
+ "benchmarks",
168
+ "typings",
169
+ ]
170
+
171
+ [tool.uv.sources.bpy]
172
+ index = "download.blender.org"
173
+
174
+ [tool.uv.sources.bpy-vrm-format-benchmarks]
175
+ workspace = true
176
+
177
+ [tool.uv.sources.starry-bpy-typings]
178
+ workspace = true
179
+
180
+ [tool.uv.build-backend]
181
+ module-name = "io_scene_vrm"
182
+
183
+ [[tool.uv.index]]
184
+ name = "download.blender.org"
185
+ url = "https://download.blender.org/pypi/"
@@ -0,0 +1,207 @@
1
+ [project]
2
+ name = "bpy-vrm-format"
3
+ version = "4.7.4"
4
+ authors = [
5
+ { name = "Isamu Mogi" },
6
+ { name = "iCyP" },
7
+ ]
8
+ description = "VRM import, export, and editing capabilities"
9
+ readme = "pypi.md"
10
+ license = { text = "SPDX-License-Identifier: MIT OR GPL-3.0-or-later" }
11
+
12
+ requires-python = "==3.10.*" # I actually want to use 3.9, but bpy 3.6.* doesn't allow it.
13
+
14
+ dependencies = [
15
+ # https://github.com/saturday06/VRM-Addon-for-Blender/blob/v3.10.1/uv.lock#L12-L27
16
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'AMD64' and sys_platform == 'win32'",
17
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'arm64' and sys_platform == 'darwin'",
18
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'darwin'",
19
+ "bpy ==3.6.*; python_version == '3.10.*' and platform_machine == 'x86_64' and sys_platform == 'linux'",
20
+ ]
21
+
22
+ [dependency-groups]
23
+ dev = [
24
+ "bpy-vrm-format-benchmarks",
25
+ "codespell",
26
+ "pygit2",
27
+ "requests",
28
+ "ruff",
29
+ "starry-bpy-typings",
30
+ "tombi",
31
+ "tomli", # for codespell
32
+ "tqdm",
33
+ "types-pygit2",
34
+ "types-tqdm",
35
+ ]
36
+
37
+ [build-system]
38
+ requires = ["uv_build>=0.12.1,<0.13.0"]
39
+ build-backend = "uv_build"
40
+
41
+ [tool.black]
42
+ extend-exclude = ".*" # Please use Ruff instead.
43
+
44
+ [tool.codespell]
45
+ skip = "*.lock,*.asset,node_modules,./tests/resources/unity/*/Library/*,./tests/resources/unity/*/Build/*"
46
+
47
+ [tool.isort]
48
+ extend_skip_glob = ["*"] # Please use Ruff instead.
49
+
50
+ [tool.mypy]
51
+ exclude = ["."]
52
+ ignore_errors = true # Please use pyright instead.
53
+
54
+ [tool.pylint.main]
55
+ ignore-paths = "." # Please use Ruff instead.
56
+
57
+ [tool.pyright]
58
+ pythonVersion = "3.9" # It overrides 'project.requires-python = "== 3.10.*"'
59
+ pythonPlatform = "All"
60
+ typeCheckingMode = "strict"
61
+ stubPath = "typings/src"
62
+ exclude = [
63
+ # Too many files in Unity folders, causing
64
+ # 'Enumeration of workspace source files is taking longer than 10 seconds.'
65
+ # warning, so explicitly excluding them
66
+ "tests/resources/unity",
67
+
68
+ # Suppress the following warning
69
+ # The exclude list is missing default excludes such as '.venv'. Consider
70
+ # adding them to avoid analyzing unnecessary files.
71
+ # Pylance(missingDefaultExcludes)
72
+ "**/.venv",
73
+
74
+ # Re-setting default exclusion folder settings since they get lost
75
+ # https://github.com/microsoft/pyright/blob/1.1.400/packages/pyright-internal/src/analyzer/service.ts#L793
76
+ "**/node_modules",
77
+ "**/__pycache__",
78
+ "**/.*",
79
+ ]
80
+
81
+ reportMissingModuleSource = false
82
+ reportCallInDefaultInitializer = true
83
+ reportUninitializedInstanceVariable = true
84
+
85
+ [[tool.pyright.executionEnvironments]]
86
+ root = "tests"
87
+ extraPaths = ["src", "typings/src", "."]
88
+ reportPrivateUsage = "none"
89
+
90
+ [tool.ruff]
91
+ target-version = "py39" # It overrides 'project.requires-python = "== 3.10.*"'
92
+ src = ["typings/src", "src"]
93
+
94
+ [tool.ruff.lint]
95
+ select = ["ALL"]
96
+ ignore = [
97
+ # ----- fixing -----
98
+
99
+ "CPY001", # Missing copyright notice at top of file
100
+ "FBT003", # Boolean positional value in function call
101
+
102
+ # ----- ignored -----
103
+
104
+ # `COM812` may cause conflicts when used with the formatter in Ruff 0.1.6
105
+ "COM812", # Trailing comma missing
106
+
107
+ "D100", # Missing docstring in public module
108
+ "D101", # Missing docstring in public class
109
+ "D102", # Missing docstring in public method
110
+ "D103", # Missing docstring in public function
111
+ "D104", # Missing docstring in public package
112
+ "D105", # Missing docstring in magic method
113
+ "D106", # Missing docstring in public nested class
114
+ "D107", # Missing docstring in `__init__`
115
+ "ERA001", # Found commented-out code
116
+
117
+ # devcontainer for windows hosts doesn't set executable permissions properly.
118
+ "EXE002", # The file is executable but no shebang is present
119
+
120
+ # https://projects.blender.org/blender/blender/issues/63713
121
+ "FA100", # Missing `from __future__ import annotations`, but uses `x`
122
+
123
+ "FIX002", # Line contains TODO, consider resolving the issue
124
+
125
+ # `ISC001` may cause conflicts when used with the formatter in Ruff 0.1.6
126
+ "ISC001", # Implicitly concatenated string literals on one line
127
+
128
+ "ISC003", # Explicitly concatenated string should be implicitly concatenated
129
+ "PERF203", # `try`-`except` within a loop incurs performance overhead
130
+ "PLC0415", # `import` should be at the top-level of a file
131
+ "PLR2004", # Magic value used in comparison, consider replacing 3 with a constant variable
132
+
133
+ # pytest is not currently used.
134
+ "PT", # flake8-pytest-style
135
+
136
+ "RET504", # Unnecessary assignment to `x` before `return` statement
137
+
138
+ # SIM118 does not handle `bpy_prop_collection` correctly.
139
+ "SIM118", # Use `key not in dict` instead of `key not in dict.keys()`
140
+
141
+ "TC001", # Move application import `x` into a type-checking block
142
+ "TC002", # Move third-party import `x` into a type-checking block
143
+ "TC003", # Move standard library import `x` into a type-checking block
144
+ "TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
145
+ "TD003", # Missing issue link on the line following this TODO
146
+
147
+ # https://projects.blender.org/blender/blender-manual/src/commit/585cc1a5eab811052ea4dda176dfce057cb6ad69/manual/advanced/extensions/addons.rst?display=source#L174-L183
148
+ "TID252", # Relative imports from parent modules are banned
149
+ ]
150
+
151
+ [tool.ruff.lint.per-file-ignores]
152
+ "examples/**/*.py" = [
153
+ "ARG002", # Unused method argument: `x`
154
+ ]
155
+ "tests/**/*.py" = [
156
+ "S603", # `subprocess` call: check for execution of untrusted input
157
+ "S607", # Starting a process with a partial executable path
158
+ "SLF001", # Private member accessed: `_x`
159
+ ]
160
+
161
+ [tool.ruff.lint.pep8-naming]
162
+ extend-ignore-names = [
163
+ "glTF2ExportUserExtension",
164
+ "glTF2ImportUserExtension",
165
+ "EXPORT_SCENE_OT_*",
166
+ "IMPORT_SCENE_OT_*",
167
+ "ICYP_OT_*",
168
+ "VRM_FH_*",
169
+ "VRM_MT_*",
170
+ "VRM_OT_*",
171
+ "VRM_PT_*",
172
+ "VRM_UL_*",
173
+ "WM_OT_*",
174
+ ]
175
+
176
+ [tool.ruff.lint.pydocstyle]
177
+ convention = "pep257"
178
+
179
+ [tool.ruff.lint.mccabe]
180
+ max-complexity = 216
181
+
182
+ [tool.ruff.lint.pylint]
183
+ max-args = 19
184
+ max-branches = 215
185
+ max-returns = 31
186
+ max-statements = 550
187
+
188
+ [tool.ruff.lint.flake8-tidy-imports.banned-api]
189
+ "unittest.mock".msg = "Please use actual objects or DI"
190
+
191
+ [tool.uv]
192
+ cache-dir = "./.local/var/cache/uv"
193
+
194
+ [tool.uv.workspace]
195
+ members = ["benchmarks", "typings"]
196
+
197
+ [tool.uv.sources]
198
+ bpy = { index = "download.blender.org" }
199
+ bpy-vrm-format-benchmarks = { workspace = true }
200
+ starry-bpy-typings = { workspace = true }
201
+
202
+ [tool.uv.build-backend]
203
+ module-name = "io_scene_vrm"
204
+
205
+ [[tool.uv.index]]
206
+ name = "download.blender.org"
207
+ url = "https://download.blender.org/pypi/"
@@ -0,0 +1,3 @@
1
+ # VRM Add-on for Blender
2
+
3
+ See https://vrm-addon-for-blender.info for more information.
@@ -0,0 +1,41 @@
1
+ # SPDX-License-Identifier: MIT OR GPL-3.0-or-later
2
+ # SPDX-FileCopyrightText: 2018 iCyP
3
+
4
+ from . import registration
5
+ from .exporter import gltf2_export_user_extension
6
+ from .importer import gltf2_import_user_extension
7
+
8
+ bl_info = {
9
+ "name": "VRM format",
10
+ "author": "saturday06, iCyP",
11
+ "version": (
12
+ 4, # x-release-please-major
13
+ 7, # x-release-please-minor
14
+ 4, # x-release-please-patch
15
+ ),
16
+ "location": "File > Import-Export",
17
+ "description": "Import-Edit-Export VRM",
18
+ "blender": (2, 93, 0),
19
+ "warning": "",
20
+ "support": "COMMUNITY",
21
+ "wiki_url": "",
22
+ "doc_url": "https://vrm-addon-for-blender.info",
23
+ "tracker_url": "https://github.com/saturday06/VRM-Addon-for-Blender/issues",
24
+ "category": "Import-Export",
25
+ }
26
+
27
+
28
+ def register() -> None:
29
+ registration.register()
30
+
31
+
32
+ def unregister() -> None:
33
+ registration.unregister()
34
+
35
+
36
+ class glTF2ImportUserExtension(gltf2_import_user_extension.glTF2ImportUserExtension):
37
+ pass
38
+
39
+
40
+ class glTF2ExportUserExtension(gltf2_export_user_extension.glTF2ExportUserExtension):
41
+ pass
@@ -0,0 +1,28 @@
1
+ schema_version = "1.0.0"
2
+ id = "vrm"
3
+ version = "4.7.4"
4
+ name = "VRM format"
5
+ tagline = "VRM import, export and editing capabilities"
6
+ maintainer = "Isamu Mogi <dyob@lunaport.net>"
7
+ type = "add-on"
8
+ website = "https://vrm-addon-for-blender.info"
9
+ tags = [
10
+ "Animation",
11
+ "Import-Export",
12
+ "Material",
13
+ "Modeling",
14
+ "Physics",
15
+ ]
16
+ blender_version_min = "4.2.0"
17
+ blender_version_max = "5.3.0"
18
+ license = [
19
+ "SPDX:MIT",
20
+ "SPDX:GPL-3.0-or-later",
21
+ ]
22
+ copyright = [
23
+ "2020 Isamu Mogi",
24
+ "2018 iCyP",
25
+ ]
26
+
27
+ [permissions]
28
+ files = "Import/export VRM from/to disk"
@@ -0,0 +1 @@
1
+ # SPDX-License-Identifier: MIT OR GPL-3.0-or-later