@volter/blender-engine 0.1.148 → 0.1.149
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.
- package/LICENSE +16 -0
- package/README.md +4 -11
- package/browser/addons/vrm/LICENSE_(OPTION1)_MIT.txt +22 -0
- package/browser/addons/vrm/LICENSE_(OPTION2)_GPL-3_0.txt +674 -0
- package/browser/addons/vrm/LICENSE_MAIN.txt +1 -0
- package/browser/addons/vrm/README.txt +3 -0
- package/browser/addons/vrm/__init__.py +41 -0
- package/browser/addons/vrm/blender_manifest.toml +16 -0
- package/browser/addons/vrm/common/__init__.py +1 -0
- package/browser/addons/vrm/common/animation.py +58 -0
- package/browser/addons/vrm/common/blender_manifest.py +82 -0
- package/browser/addons/vrm/common/char.py +16 -0
- package/browser/addons/vrm/common/convert.py +287 -0
- package/browser/addons/vrm/common/convert_any.py +48 -0
- package/browser/addons/vrm/common/debug.py +40 -0
- package/browser/addons/vrm/common/deep.py +162 -0
- package/browser/addons/vrm/common/error_dialog.py +274 -0
- package/browser/addons/vrm/common/fs.py +71 -0
- package/browser/addons/vrm/common/gl.py +20 -0
- package/browser/addons/vrm/common/gltf.py +1149 -0
- package/browser/addons/vrm/common/human_bone_mapper/__init__.py +1 -0
- package/browser/addons/vrm/common/human_bone_mapper/biped_mapping.py +84 -0
- package/browser/addons/vrm/common/human_bone_mapper/cats_blender_plugin_fix_model_mapping.py +63 -0
- package/browser/addons/vrm/common/human_bone_mapper/human_bone_mapper.py +203 -0
- package/browser/addons/vrm/common/human_bone_mapper/microsoft_rocketbox_mapping.py +69 -0
- package/browser/addons/vrm/common/human_bone_mapper/mixamo_mapping.py +62 -0
- package/browser/addons/vrm/common/human_bone_mapper/mmd_mapping.py +115 -0
- package/browser/addons/vrm/common/human_bone_mapper/mpfb_mapping.py +120 -0
- package/browser/addons/vrm/common/human_bone_mapper/ready_player_me_mapping.py +65 -0
- package/browser/addons/vrm/common/human_bone_mapper/reallusion_mapping.py +94 -0
- package/browser/addons/vrm/common/human_bone_mapper/rigify_meta_rig_mapping.py +65 -0
- package/browser/addons/vrm/common/human_bone_mapper/structure_based_mapping.py +891 -0
- package/browser/addons/vrm/common/human_bone_mapper/unreal_mapping.py +62 -0
- package/browser/addons/vrm/common/human_bone_mapper/vrm_addon_mapping.py +112 -0
- package/browser/addons/vrm/common/human_bone_mapper/vroid_mapping.py +89 -0
- package/browser/addons/vrm/common/legacy_gltf.py +16 -0
- package/browser/addons/vrm/common/logger.py +84 -0
- package/browser/addons/vrm/common/mtoon0.blend +0 -0
- package/browser/addons/vrm/common/mtoon1.blend +0 -0
- package/browser/addons/vrm/common/mtoon1_outline.blend +0 -0
- package/browser/addons/vrm/common/mtoon_auto_setup.blend +0 -0
- package/browser/addons/vrm/common/mtoon_unversioned.py +62 -0
- package/browser/addons/vrm/common/ops/__init__.py +10 -0
- package/browser/addons/vrm/common/ops/export_scene.py +67 -0
- package/browser/addons/vrm/common/ops/icyp.py +53 -0
- package/browser/addons/vrm/common/ops/import_scene.py +57 -0
- package/browser/addons/vrm/common/ops/vrm.py +2380 -0
- package/browser/addons/vrm/common/ops/wm.py +167 -0
- package/browser/addons/vrm/common/preferences.py +362 -0
- package/browser/addons/vrm/common/progress.py +87 -0
- package/browser/addons/vrm/common/rotation.py +89 -0
- package/browser/addons/vrm/common/safe_removal.py +46 -0
- package/browser/addons/vrm/common/scene_watcher.py +230 -0
- package/browser/addons/vrm/common/shader.py +2243 -0
- package/browser/addons/vrm/common/shape_key_mapper/__init__.py +1 -0
- package/browser/addons/vrm/common/shape_key_mapper/arkit_mapping.py +168 -0
- package/browser/addons/vrm/common/shape_key_mapper/mmd_mapping.py +62 -0
- package/browser/addons/vrm/common/shape_key_mapper/ready_player_me_mapping.py +52 -0
- package/browser/addons/vrm/common/shape_key_mapper/vrchat_mapping.py +17 -0
- package/browser/addons/vrm/common/third_party_user_extension.py +214 -0
- package/browser/addons/vrm/common/transparent_z_write.blend +0 -0
- package/browser/addons/vrm/common/version.py +161 -0
- package/browser/addons/vrm/common/vrm0/__init__.py +1 -0
- package/browser/addons/vrm/common/vrm0/human_bone.py +662 -0
- package/browser/addons/vrm/common/vrm0/material_property.py +346 -0
- package/browser/addons/vrm/common/vrm1/__init__.py +1 -0
- package/browser/addons/vrm/common/vrm1/expression_preset.py +207 -0
- package/browser/addons/vrm/common/vrm1/human_bone.py +822 -0
- package/browser/addons/vrm/common/workspace.py +227 -0
- package/browser/addons/vrm/common/writable_context.py +77 -0
- package/browser/addons/vrm/documentation/en-us/animation/index.md +63 -0
- package/browser/addons/vrm/documentation/en-us/create-humanoid-vrm-from-scratch/index.md +131 -0
- package/browser/addons/vrm/documentation/en-us/create-simple-vrm-from-scratch/index.md +30 -0
- package/browser/addons/vrm/documentation/en-us/development/index.md +136 -0
- package/browser/addons/vrm/documentation/en-us/index.md +41 -0
- package/browser/addons/vrm/documentation/en-us/installation/index.md +152 -0
- package/browser/addons/vrm/documentation/en-us/material-mtoon/index.md +122 -0
- package/browser/addons/vrm/documentation/en-us/material-pbr/index.md +94 -0
- package/browser/addons/vrm/documentation/en-us/scripting-api/index.md +391 -0
- package/browser/addons/vrm/documentation/en-us/ui/export_scene.vrm/index.md +57 -0
- package/browser/addons/vrm/documentation/en-us/ui/export_scene.vrma/index.md +17 -0
- package/browser/addons/vrm/documentation/en-us/ui/import_scene.vrm/index.md +61 -0
- package/browser/addons/vrm/documentation/en-us/ui/import_scene.vrma/index.md +13 -0
- package/browser/addons/vrm/documentation/ja-jp/animation/index.md +57 -0
- package/browser/addons/vrm/documentation/ja-jp/create-humanoid-vrm-from-scratch/index.md +129 -0
- package/browser/addons/vrm/documentation/ja-jp/create-simple-vrm-from-scratch/index.md +29 -0
- package/browser/addons/vrm/documentation/ja-jp/development/index.md +137 -0
- package/browser/addons/vrm/documentation/ja-jp/index.md +37 -0
- package/browser/addons/vrm/documentation/ja-jp/installation/index.md +150 -0
- package/browser/addons/vrm/documentation/ja-jp/material-mtoon/index.md +113 -0
- package/browser/addons/vrm/documentation/ja-jp/material-pbr/index.md +90 -0
- package/browser/addons/vrm/documentation/ja-jp/scripting-api/index.md +389 -0
- package/browser/addons/vrm/documentation/ja-jp/ui/export_scene.vrm/index.md +55 -0
- package/browser/addons/vrm/documentation/ja-jp/ui/export_scene.vrma/index.md +19 -0
- package/browser/addons/vrm/documentation/ja-jp/ui/import_scene.vrm/index.md +56 -0
- package/browser/addons/vrm/documentation/ja-jp/ui/import_scene.vrma/index.md +14 -0
- package/browser/addons/vrm/editor/__init__.py +1 -0
- package/browser/addons/vrm/editor/extension.py +425 -0
- package/browser/addons/vrm/editor/extension_accessor.py +75 -0
- package/browser/addons/vrm/editor/handler.py +84 -0
- package/browser/addons/vrm/editor/khr_character/__init__.py +1 -0
- package/browser/addons/vrm/editor/khr_character/panel.py +69 -0
- package/browser/addons/vrm/editor/khr_character/property_group.py +27 -0
- package/browser/addons/vrm/editor/khr_xmp_json_ld/__init__.py +1 -0
- package/browser/addons/vrm/editor/khr_xmp_json_ld/ops.py +464 -0
- package/browser/addons/vrm/editor/khr_xmp_json_ld/panel.py +136 -0
- package/browser/addons/vrm/editor/khr_xmp_json_ld/property_group.py +83 -0
- package/browser/addons/vrm/editor/khr_xmp_json_ld/ui_list.py +198 -0
- package/browser/addons/vrm/editor/make_armature.py +709 -0
- package/browser/addons/vrm/editor/menu.py +147 -0
- package/browser/addons/vrm/editor/migration.py +297 -0
- package/browser/addons/vrm/editor/mtoon1/__init__.py +1 -0
- package/browser/addons/vrm/editor/mtoon1/handler.py +20 -0
- package/browser/addons/vrm/editor/mtoon1/migration.py +536 -0
- package/browser/addons/vrm/editor/mtoon1/ops.py +304 -0
- package/browser/addons/vrm/editor/mtoon1/panel.py +442 -0
- package/browser/addons/vrm/editor/mtoon1/property_group.py +4977 -0
- package/browser/addons/vrm/editor/mtoon1/scene_watcher.py +381 -0
- package/browser/addons/vrm/editor/node_constraint1/__init__.py +1 -0
- package/browser/addons/vrm/editor/node_constraint1/panel.py +317 -0
- package/browser/addons/vrm/editor/node_constraint1/property_group.py +25 -0
- package/browser/addons/vrm/editor/ops.py +471 -0
- package/browser/addons/vrm/editor/panel.py +315 -0
- package/browser/addons/vrm/editor/property_group.py +888 -0
- package/browser/addons/vrm/editor/search.py +682 -0
- package/browser/addons/vrm/editor/spring_bone1/__init__.py +1 -0
- package/browser/addons/vrm/editor/spring_bone1/handler.py +994 -0
- package/browser/addons/vrm/editor/spring_bone1/menu.py +246 -0
- package/browser/addons/vrm/editor/spring_bone1/migration.py +86 -0
- package/browser/addons/vrm/editor/spring_bone1/ops.py +1679 -0
- package/browser/addons/vrm/editor/spring_bone1/panel.py +605 -0
- package/browser/addons/vrm/editor/spring_bone1/property_group.py +1457 -0
- package/browser/addons/vrm/editor/spring_bone1/ui_list.py +408 -0
- package/browser/addons/vrm/editor/subscription.py +123 -0
- package/browser/addons/vrm/editor/t_pose.py +713 -0
- package/browser/addons/vrm/editor/validation.py +1271 -0
- package/browser/addons/vrm/editor/vrm0/__init__.py +1 -0
- package/browser/addons/vrm/editor/vrm0/gizmo_group.py +63 -0
- package/browser/addons/vrm/editor/vrm0/handler.py +23 -0
- package/browser/addons/vrm/editor/vrm0/menu.py +145 -0
- package/browser/addons/vrm/editor/vrm0/migration.py +761 -0
- package/browser/addons/vrm/editor/vrm0/ops.py +2145 -0
- package/browser/addons/vrm/editor/vrm0/panel.py +1333 -0
- package/browser/addons/vrm/editor/vrm0/property_group.py +1818 -0
- package/browser/addons/vrm/editor/vrm0/ui_list.py +688 -0
- package/browser/addons/vrm/editor/vrm1/__init__.py +1 -0
- package/browser/addons/vrm/editor/vrm1/handler.py +28 -0
- package/browser/addons/vrm/editor/vrm1/menu.py +76 -0
- package/browser/addons/vrm/editor/vrm1/migration.py +321 -0
- package/browser/addons/vrm/editor/vrm1/ops.py +2679 -0
- package/browser/addons/vrm/editor/vrm1/panel.py +1243 -0
- package/browser/addons/vrm/editor/vrm1/property_group.py +2087 -0
- package/browser/addons/vrm/editor/vrm1/scene_watcher.py +90 -0
- package/browser/addons/vrm/editor/vrm1/ui_list.py +533 -0
- package/browser/addons/vrm/exporter/__init__.py +1 -0
- package/browser/addons/vrm/exporter/abstract_base_vrm_exporter.py +628 -0
- package/browser/addons/vrm/exporter/export_scene.py +930 -0
- package/browser/addons/vrm/exporter/gltf2_export_user_extension.py +45 -0
- package/browser/addons/vrm/exporter/khr_character_exporter.py +34 -0
- package/browser/addons/vrm/exporter/vrm0_exporter.py +4020 -0
- package/browser/addons/vrm/exporter/vrm1_exporter.py +3682 -0
- package/browser/addons/vrm/exporter/vrm_animation_exporter.py +1035 -0
- package/browser/addons/vrm/external/__init__.py +1 -0
- package/browser/addons/vrm/external/auto_rig_pro_support.py +3 -0
- package/browser/addons/vrm/external/io_scene_gltf2_support.py +418 -0
- package/browser/addons/vrm/external/rigify_support.py +1 -0
- package/browser/addons/vrm/importer/__init__.py +1 -0
- package/browser/addons/vrm/importer/abstract_base_vrm_importer.py +1548 -0
- package/browser/addons/vrm/importer/file_handler.py +34 -0
- package/browser/addons/vrm/importer/gltf2_import_user_extension.py +268 -0
- package/browser/addons/vrm/importer/import_scene.py +646 -0
- package/browser/addons/vrm/importer/license_validation.py +198 -0
- package/browser/addons/vrm/importer/vrm0_importer.py +1723 -0
- package/browser/addons/vrm/importer/vrm1_importer.py +2014 -0
- package/browser/addons/vrm/importer/vrm_animation_importer.py +763 -0
- package/browser/addons/vrm/importer/vrm_diff.py +316 -0
- package/browser/addons/vrm/locale/__init__.py +1 -0
- package/browser/addons/vrm/locale/ja_jp.py +826 -0
- package/browser/addons/vrm/locale/ruff.toml +8 -0
- package/browser/addons/vrm/locale/translation_dictionary.py +10 -0
- package/browser/addons/vrm/locale/zh_hans.py +928 -0
- package/browser/addons/vrm/registration.py +670 -0
- package/browser/addons/vrm.json +18 -0
- package/browser/blender-emscripten-engine.mts +60 -128
- package/browser/blender-engine.mts +20 -186
- package/browser/blender-wali-engine.mts +35 -81
- package/browser/describe-thrown.mts +3 -6
- package/browser/document-chunks.mts +4 -16
- package/browser/gltf_export.py +3161 -0
- package/browser/heap-growth.mts +23 -0
- package/browser/index.ts +2 -0
- package/browser/protocol.ts +119 -35
- package/browser/pull-job.mts +2 -10
- package/browser/rna.ts +190 -73
- package/browser/runtime.ts +197 -82
- package/browser/session-addons.mts +33 -0
- package/browser/session-frame.mts +5 -24
- package/browser/session.py +1338 -1427
- package/browser/three/attach-presenter.ts +11 -39
- package/browser/three/blender-base64.ts +1 -36
- package/browser/three/blender-corner-normals.ts +1 -23
- package/browser/three/blender-display-shaders.json +1 -1
- package/browser/three/blender-display-shaders.lut +0 -0
- package/browser/three/blender-display-transform.ts +2 -1
- package/browser/three/blender-frame-columns.ts +5 -13
- package/browser/three/blender-graph-material.ts +18 -3
- package/browser/three/blender-node-graph.ts +10 -34
- package/browser/three/blender-physical-material.ts +2 -31
- package/browser/three/blender-runtime-armature.ts +7 -60
- package/browser/three/blender-runtime-frame.ts +9 -23
- package/browser/three/blender-runtime-geometry.ts +22 -26
- package/browser/three/blender-runtime-lighting.ts +48 -178
- package/browser/three/blender-runtime-shadows.ts +187 -1
- package/browser/three/blender-runtime-skeleton.ts +53 -1
- package/browser/three/blender-runtime-view.ts +505 -283
- package/browser/three/blender-runtime-weights.ts +9 -72
- package/browser/three/blender-sky.ts +13 -33
- package/browser/three/blender-triangulate.ts +7 -35
- package/browser/three/blender-viewport-sampling.ts +235 -0
- package/browser/three/blender-workbench-material.ts +25 -29
- package/browser/three/blender-workbench-outline.ts +199 -0
- package/browser/three/blender-world-volume.ts +62 -10
- package/browser/three/presenter.ts +10 -26
- package/browser/three/release.ts +5 -21
- package/browser/three/sky-precompute-worker.ts +1 -18
- package/browser/three/sky-worker.ts +5 -23
- package/browser/three/world-field-sampler.ts +12 -26
- package/browser/volter_three.py +9 -105
- package/browser/worker.ts +156 -151
- package/package.json +5 -2
- package/wasm/BUNDLE.json +17 -17
- package/wasm/DEPENDENCY-LICENSES.txt +14 -0
- package/wasm/blender_browser.data.br +0 -0
- package/wasm/blender_browser.js +1 -1
- package/wasm/blender_browser.wasm.br +0 -0
- package/browser/frame-transfer.mts +0 -19
- package/browser/three/agx-base-srgb.lut +0 -0
- package/browser/three/agx-look-medium-high-contrast.lut +0 -0
- package/browser/three/agx-look-punchy.lut +0 -0
- package/browser/three/blender-agx.ts +0 -235
- package/browser/three/blender-display-lut.ts +0 -145
- package/browser/three/blender-filmic.ts +0 -49
- package/browser/three/blender-standard.ts +0 -68
- package/browser/three/blender-world-visibility.ts +0 -278
- package/browser/three/filmic-srgb.lut +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
from ..vrm1.human_bone import HumanBoneSpecification, HumanBoneSpecifications
|
|
6
|
+
|
|
7
|
+
MAPPING: Final[Mapping[str, HumanBoneSpecification]] = {
|
|
8
|
+
"pelvis": HumanBoneSpecifications.HIPS,
|
|
9
|
+
"spine_01": HumanBoneSpecifications.SPINE,
|
|
10
|
+
"spine_02": HumanBoneSpecifications.CHEST,
|
|
11
|
+
"spine_03": HumanBoneSpecifications.UPPER_CHEST,
|
|
12
|
+
"neck_01": HumanBoneSpecifications.NECK,
|
|
13
|
+
"head": HumanBoneSpecifications.HEAD,
|
|
14
|
+
"clavicle_r": HumanBoneSpecifications.RIGHT_SHOULDER,
|
|
15
|
+
"upperarm_r": HumanBoneSpecifications.RIGHT_UPPER_ARM,
|
|
16
|
+
"lowerarm_r": HumanBoneSpecifications.RIGHT_LOWER_ARM,
|
|
17
|
+
"hand_r": HumanBoneSpecifications.RIGHT_HAND,
|
|
18
|
+
"clavicle_l": HumanBoneSpecifications.LEFT_SHOULDER,
|
|
19
|
+
"upperarm_l": HumanBoneSpecifications.LEFT_UPPER_ARM,
|
|
20
|
+
"lowerarm_l": HumanBoneSpecifications.LEFT_LOWER_ARM,
|
|
21
|
+
"hand_l": HumanBoneSpecifications.LEFT_HAND,
|
|
22
|
+
"thigh_r": HumanBoneSpecifications.RIGHT_UPPER_LEG,
|
|
23
|
+
"calf_r": HumanBoneSpecifications.RIGHT_LOWER_LEG,
|
|
24
|
+
"foot_r": HumanBoneSpecifications.RIGHT_FOOT,
|
|
25
|
+
"ball_r": HumanBoneSpecifications.RIGHT_TOES,
|
|
26
|
+
"thigh_l": HumanBoneSpecifications.LEFT_UPPER_LEG,
|
|
27
|
+
"calf_l": HumanBoneSpecifications.LEFT_LOWER_LEG,
|
|
28
|
+
"foot_l": HumanBoneSpecifications.LEFT_FOOT,
|
|
29
|
+
"ball_l": HumanBoneSpecifications.LEFT_TOES,
|
|
30
|
+
"thumb_01_r": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
31
|
+
"thumb_02_r": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
32
|
+
"thumb_03_r": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
33
|
+
"thumb_01_l": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
34
|
+
"thumb_02_l": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
35
|
+
"thumb_03_l": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
36
|
+
"index_01_r": HumanBoneSpecifications.RIGHT_INDEX_PROXIMAL,
|
|
37
|
+
"index_02_r": HumanBoneSpecifications.RIGHT_INDEX_INTERMEDIATE,
|
|
38
|
+
"index_03_r": HumanBoneSpecifications.RIGHT_INDEX_DISTAL,
|
|
39
|
+
"index_01_l": HumanBoneSpecifications.LEFT_INDEX_PROXIMAL,
|
|
40
|
+
"index_02_l": HumanBoneSpecifications.LEFT_INDEX_INTERMEDIATE,
|
|
41
|
+
"index_03_l": HumanBoneSpecifications.LEFT_INDEX_DISTAL,
|
|
42
|
+
"middle_01_r": HumanBoneSpecifications.RIGHT_MIDDLE_PROXIMAL,
|
|
43
|
+
"middle_02_r": HumanBoneSpecifications.RIGHT_MIDDLE_INTERMEDIATE,
|
|
44
|
+
"middle_03_r": HumanBoneSpecifications.RIGHT_MIDDLE_DISTAL,
|
|
45
|
+
"middle_01_l": HumanBoneSpecifications.LEFT_MIDDLE_PROXIMAL,
|
|
46
|
+
"middle_02_l": HumanBoneSpecifications.LEFT_MIDDLE_INTERMEDIATE,
|
|
47
|
+
"middle_03_l": HumanBoneSpecifications.LEFT_MIDDLE_DISTAL,
|
|
48
|
+
"ring_01_r": HumanBoneSpecifications.RIGHT_RING_PROXIMAL,
|
|
49
|
+
"ring_02_r": HumanBoneSpecifications.RIGHT_RING_INTERMEDIATE,
|
|
50
|
+
"ring_03_r": HumanBoneSpecifications.RIGHT_RING_DISTAL,
|
|
51
|
+
"ring_01_l": HumanBoneSpecifications.LEFT_RING_PROXIMAL,
|
|
52
|
+
"ring_02_l": HumanBoneSpecifications.LEFT_RING_INTERMEDIATE,
|
|
53
|
+
"ring_03_l": HumanBoneSpecifications.LEFT_RING_DISTAL,
|
|
54
|
+
"pinky_01_r": HumanBoneSpecifications.RIGHT_LITTLE_PROXIMAL,
|
|
55
|
+
"pinky_02_r": HumanBoneSpecifications.RIGHT_LITTLE_INTERMEDIATE,
|
|
56
|
+
"pinky_03_r": HumanBoneSpecifications.RIGHT_LITTLE_DISTAL,
|
|
57
|
+
"pinky_01_l": HumanBoneSpecifications.LEFT_LITTLE_PROXIMAL,
|
|
58
|
+
"pinky_02_l": HumanBoneSpecifications.LEFT_LITTLE_INTERMEDIATE,
|
|
59
|
+
"pinky_03_l": HumanBoneSpecifications.LEFT_LITTLE_DISTAL,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
CONFIG: Final = ("Unreal", MAPPING)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Final
|
|
4
|
+
|
|
5
|
+
from ..vrm1.human_bone import HumanBoneSpecification, HumanBoneSpecifications
|
|
6
|
+
|
|
7
|
+
MAPPING: Final[Mapping[str, HumanBoneSpecification]] = {
|
|
8
|
+
"head": HumanBoneSpecifications.HEAD,
|
|
9
|
+
"spine": HumanBoneSpecifications.SPINE,
|
|
10
|
+
"hips": HumanBoneSpecifications.HIPS,
|
|
11
|
+
"upper_arm.R": HumanBoneSpecifications.RIGHT_UPPER_ARM,
|
|
12
|
+
"lower_arm.R": HumanBoneSpecifications.RIGHT_LOWER_ARM,
|
|
13
|
+
"hand.R": HumanBoneSpecifications.RIGHT_HAND,
|
|
14
|
+
"upper_arm.L": HumanBoneSpecifications.LEFT_UPPER_ARM,
|
|
15
|
+
"lower_arm.L": HumanBoneSpecifications.LEFT_LOWER_ARM,
|
|
16
|
+
"hand.L": HumanBoneSpecifications.LEFT_HAND,
|
|
17
|
+
"upper_leg.R": HumanBoneSpecifications.RIGHT_UPPER_LEG,
|
|
18
|
+
"lower_leg.R": HumanBoneSpecifications.RIGHT_LOWER_LEG,
|
|
19
|
+
"foot.R": HumanBoneSpecifications.RIGHT_FOOT,
|
|
20
|
+
"upper_leg.L": HumanBoneSpecifications.LEFT_UPPER_LEG,
|
|
21
|
+
"lower_leg.L": HumanBoneSpecifications.LEFT_LOWER_LEG,
|
|
22
|
+
"foot.L": HumanBoneSpecifications.LEFT_FOOT,
|
|
23
|
+
"eye.R": HumanBoneSpecifications.RIGHT_EYE,
|
|
24
|
+
"eye.L": HumanBoneSpecifications.LEFT_EYE,
|
|
25
|
+
"neck": HumanBoneSpecifications.NECK,
|
|
26
|
+
"shoulder.L": HumanBoneSpecifications.LEFT_SHOULDER,
|
|
27
|
+
"shoulder.R": HumanBoneSpecifications.RIGHT_SHOULDER,
|
|
28
|
+
"upper_chest": HumanBoneSpecifications.UPPER_CHEST,
|
|
29
|
+
"chest": HumanBoneSpecifications.CHEST,
|
|
30
|
+
"toes.R": HumanBoneSpecifications.RIGHT_TOES,
|
|
31
|
+
"toes.L": HumanBoneSpecifications.LEFT_TOES,
|
|
32
|
+
"thumb_metacarpal.L": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
33
|
+
"thumb.metacarpal.L": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
34
|
+
"thumb_proximal.L": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
35
|
+
"thumb.proximal.L": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
36
|
+
"thumb_distal.L": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
37
|
+
"thumb.distal.L": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
38
|
+
"index_proximal.L": HumanBoneSpecifications.LEFT_INDEX_PROXIMAL,
|
|
39
|
+
"index.proximal.L": HumanBoneSpecifications.LEFT_INDEX_PROXIMAL,
|
|
40
|
+
"index_intermediate.L": HumanBoneSpecifications.LEFT_INDEX_INTERMEDIATE,
|
|
41
|
+
"index.intermediate.L": HumanBoneSpecifications.LEFT_INDEX_INTERMEDIATE,
|
|
42
|
+
"index_distal.L": HumanBoneSpecifications.LEFT_INDEX_DISTAL,
|
|
43
|
+
"index.distal.L": HumanBoneSpecifications.LEFT_INDEX_DISTAL,
|
|
44
|
+
"middle_proximal.L": HumanBoneSpecifications.LEFT_MIDDLE_PROXIMAL,
|
|
45
|
+
"middle.proximal.L": HumanBoneSpecifications.LEFT_MIDDLE_PROXIMAL,
|
|
46
|
+
"middle_intermediate.L": HumanBoneSpecifications.LEFT_MIDDLE_INTERMEDIATE,
|
|
47
|
+
"middle.intermediate.L": HumanBoneSpecifications.LEFT_MIDDLE_INTERMEDIATE,
|
|
48
|
+
"middle_distal.L": HumanBoneSpecifications.LEFT_MIDDLE_DISTAL,
|
|
49
|
+
"middle.distal.L": HumanBoneSpecifications.LEFT_MIDDLE_DISTAL,
|
|
50
|
+
"ring_proximal.L": HumanBoneSpecifications.LEFT_RING_PROXIMAL,
|
|
51
|
+
"ring.proximal.L": HumanBoneSpecifications.LEFT_RING_PROXIMAL,
|
|
52
|
+
"ring_intermediate.L": HumanBoneSpecifications.LEFT_RING_INTERMEDIATE,
|
|
53
|
+
"ring.intermediate.L": HumanBoneSpecifications.LEFT_RING_INTERMEDIATE,
|
|
54
|
+
"ring_distal.L": HumanBoneSpecifications.LEFT_RING_DISTAL,
|
|
55
|
+
"ring.distal.L": HumanBoneSpecifications.LEFT_RING_DISTAL,
|
|
56
|
+
"little_proximal.L": HumanBoneSpecifications.LEFT_LITTLE_PROXIMAL,
|
|
57
|
+
"little.proximal.L": HumanBoneSpecifications.LEFT_LITTLE_PROXIMAL,
|
|
58
|
+
"little_intermediate.L": HumanBoneSpecifications.LEFT_LITTLE_INTERMEDIATE,
|
|
59
|
+
"little.intermediate.L": HumanBoneSpecifications.LEFT_LITTLE_INTERMEDIATE,
|
|
60
|
+
"little_distal.L": HumanBoneSpecifications.LEFT_LITTLE_DISTAL,
|
|
61
|
+
"little.distal.L": HumanBoneSpecifications.LEFT_LITTLE_DISTAL,
|
|
62
|
+
"thumb_metacarpal.R": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
63
|
+
"thumb.metacarpal.R": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
64
|
+
"thumb_proximal.R": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
65
|
+
"thumb.proximal.R": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
66
|
+
"thumb_distal.R": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
67
|
+
"thumb.distal.R": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
68
|
+
"index_proximal.R": HumanBoneSpecifications.RIGHT_INDEX_PROXIMAL,
|
|
69
|
+
"index.proximal.R": HumanBoneSpecifications.RIGHT_INDEX_PROXIMAL,
|
|
70
|
+
"index_intermediate.R": HumanBoneSpecifications.RIGHT_INDEX_INTERMEDIATE,
|
|
71
|
+
"index.intermediate.R": HumanBoneSpecifications.RIGHT_INDEX_INTERMEDIATE,
|
|
72
|
+
"index_distal.R": HumanBoneSpecifications.RIGHT_INDEX_DISTAL,
|
|
73
|
+
"index.distal.R": HumanBoneSpecifications.RIGHT_INDEX_DISTAL,
|
|
74
|
+
"middle_proximal.R": HumanBoneSpecifications.RIGHT_MIDDLE_PROXIMAL,
|
|
75
|
+
"middle.proximal.R": HumanBoneSpecifications.RIGHT_MIDDLE_PROXIMAL,
|
|
76
|
+
"middle_intermediate.R": HumanBoneSpecifications.RIGHT_MIDDLE_INTERMEDIATE,
|
|
77
|
+
"middle.intermediate.R": HumanBoneSpecifications.RIGHT_MIDDLE_INTERMEDIATE,
|
|
78
|
+
"middle_distal.R": HumanBoneSpecifications.RIGHT_MIDDLE_DISTAL,
|
|
79
|
+
"middle.distal.R": HumanBoneSpecifications.RIGHT_MIDDLE_DISTAL,
|
|
80
|
+
"ring_proximal.R": HumanBoneSpecifications.RIGHT_RING_PROXIMAL,
|
|
81
|
+
"ring.proximal.R": HumanBoneSpecifications.RIGHT_RING_PROXIMAL,
|
|
82
|
+
"ring_intermediate.R": HumanBoneSpecifications.RIGHT_RING_INTERMEDIATE,
|
|
83
|
+
"ring.intermediate.R": HumanBoneSpecifications.RIGHT_RING_INTERMEDIATE,
|
|
84
|
+
"ring_distal.R": HumanBoneSpecifications.RIGHT_RING_DISTAL,
|
|
85
|
+
"ring.distal.R": HumanBoneSpecifications.RIGHT_RING_DISTAL,
|
|
86
|
+
"little_proximal.R": HumanBoneSpecifications.RIGHT_LITTLE_PROXIMAL,
|
|
87
|
+
"little.proximal.R": HumanBoneSpecifications.RIGHT_LITTLE_PROXIMAL,
|
|
88
|
+
"little_intermediate.R": HumanBoneSpecifications.RIGHT_LITTLE_INTERMEDIATE,
|
|
89
|
+
"little.intermediate.R": HumanBoneSpecifications.RIGHT_LITTLE_INTERMEDIATE,
|
|
90
|
+
"little_distal.R": HumanBoneSpecifications.RIGHT_LITTLE_DISTAL,
|
|
91
|
+
"little.distal.R": HumanBoneSpecifications.RIGHT_LITTLE_DISTAL,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
CONFIG_VRM1: Final = ("VRM Add-on (VRM1)", MAPPING)
|
|
95
|
+
CONFIG_VRM0: Final = (
|
|
96
|
+
"VRM Add-on (VRM0)",
|
|
97
|
+
{
|
|
98
|
+
**MAPPING,
|
|
99
|
+
"thumb_proximal.L": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
100
|
+
"thumb.proximal.L": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
101
|
+
"thumb_intermediate.L": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
102
|
+
"thumb.intermediate.L": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
103
|
+
"thumb_distal.L": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
104
|
+
"thumb.distal.L": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
105
|
+
"thumb_proximal.R": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
106
|
+
"thumb.proximal.R": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
107
|
+
"thumb_intermediate.R": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
108
|
+
"thumb.intermediate.R": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
109
|
+
"thumb_distal.R": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
110
|
+
"thumb.distal.R": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
111
|
+
},
|
|
112
|
+
)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
import re
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Final
|
|
5
|
+
|
|
6
|
+
from ..vrm1.human_bone import HumanBoneSpecification, HumanBoneSpecifications
|
|
7
|
+
|
|
8
|
+
LEFT_PATTERN, RIGHT_PATTERN, FULL_PATTERN = (
|
|
9
|
+
re.compile("^J_(Adj|Bip|Opt|Sec)_L_"),
|
|
10
|
+
re.compile("^J_(Adj|Bip|Opt|Sec)_R_"),
|
|
11
|
+
re.compile("^J_(Adj|Bip|Opt|Sec)_([CLR]_)?"),
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def symmetrise_vroid_bone_name(bone_name: str) -> str:
|
|
16
|
+
left = LEFT_PATTERN.sub("", bone_name)
|
|
17
|
+
if left != bone_name:
|
|
18
|
+
return left + "_L"
|
|
19
|
+
|
|
20
|
+
right = RIGHT_PATTERN.sub("", bone_name)
|
|
21
|
+
if right != bone_name:
|
|
22
|
+
return right + "_R"
|
|
23
|
+
|
|
24
|
+
return FULL_PATTERN.sub("", bone_name)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
MAPPING: Final[Mapping[str, HumanBoneSpecification]] = {
|
|
28
|
+
"J_Bip_C_Hips": HumanBoneSpecifications.HIPS,
|
|
29
|
+
"J_Bip_C_Spine": HumanBoneSpecifications.SPINE,
|
|
30
|
+
"J_Bip_C_Chest": HumanBoneSpecifications.CHEST,
|
|
31
|
+
"J_Bip_C_UpperChest": HumanBoneSpecifications.UPPER_CHEST,
|
|
32
|
+
"J_Bip_C_Neck": HumanBoneSpecifications.NECK,
|
|
33
|
+
"J_Bip_C_Head": HumanBoneSpecifications.HEAD,
|
|
34
|
+
"J_Adj_L_FaceEye": HumanBoneSpecifications.LEFT_EYE,
|
|
35
|
+
"J_Adj_R_FaceEye": HumanBoneSpecifications.RIGHT_EYE,
|
|
36
|
+
"J_Bip_L_UpperLeg": HumanBoneSpecifications.LEFT_UPPER_LEG,
|
|
37
|
+
"J_Bip_L_LowerLeg": HumanBoneSpecifications.LEFT_LOWER_LEG,
|
|
38
|
+
"J_Bip_L_Foot": HumanBoneSpecifications.LEFT_FOOT,
|
|
39
|
+
"J_Bip_L_ToeBase": HumanBoneSpecifications.LEFT_TOES,
|
|
40
|
+
"J_Bip_R_UpperLeg": HumanBoneSpecifications.RIGHT_UPPER_LEG,
|
|
41
|
+
"J_Bip_R_LowerLeg": HumanBoneSpecifications.RIGHT_LOWER_LEG,
|
|
42
|
+
"J_Bip_R_Foot": HumanBoneSpecifications.RIGHT_FOOT,
|
|
43
|
+
"J_Bip_R_ToeBase": HumanBoneSpecifications.RIGHT_TOES,
|
|
44
|
+
"J_Bip_L_Shoulder": HumanBoneSpecifications.LEFT_SHOULDER,
|
|
45
|
+
"J_Bip_L_UpperArm": HumanBoneSpecifications.LEFT_UPPER_ARM,
|
|
46
|
+
"J_Bip_L_LowerArm": HumanBoneSpecifications.LEFT_LOWER_ARM,
|
|
47
|
+
"J_Bip_L_Hand": HumanBoneSpecifications.LEFT_HAND,
|
|
48
|
+
"J_Bip_R_Shoulder": HumanBoneSpecifications.RIGHT_SHOULDER,
|
|
49
|
+
"J_Bip_R_UpperArm": HumanBoneSpecifications.RIGHT_UPPER_ARM,
|
|
50
|
+
"J_Bip_R_LowerArm": HumanBoneSpecifications.RIGHT_LOWER_ARM,
|
|
51
|
+
"J_Bip_R_Hand": HumanBoneSpecifications.RIGHT_HAND,
|
|
52
|
+
"J_Bip_L_Thumb1": HumanBoneSpecifications.LEFT_THUMB_METACARPAL,
|
|
53
|
+
"J_Bip_L_Thumb2": HumanBoneSpecifications.LEFT_THUMB_PROXIMAL,
|
|
54
|
+
"J_Bip_L_Thumb3": HumanBoneSpecifications.LEFT_THUMB_DISTAL,
|
|
55
|
+
"J_Bip_L_Index1": HumanBoneSpecifications.LEFT_INDEX_PROXIMAL,
|
|
56
|
+
"J_Bip_L_Index2": HumanBoneSpecifications.LEFT_INDEX_INTERMEDIATE,
|
|
57
|
+
"J_Bip_L_Index3": HumanBoneSpecifications.LEFT_INDEX_DISTAL,
|
|
58
|
+
"J_Bip_L_Middle1": HumanBoneSpecifications.LEFT_MIDDLE_PROXIMAL,
|
|
59
|
+
"J_Bip_L_Middle2": HumanBoneSpecifications.LEFT_MIDDLE_INTERMEDIATE,
|
|
60
|
+
"J_Bip_L_Middle3": HumanBoneSpecifications.LEFT_MIDDLE_DISTAL,
|
|
61
|
+
"J_Bip_L_Ring1": HumanBoneSpecifications.LEFT_RING_PROXIMAL,
|
|
62
|
+
"J_Bip_L_Ring2": HumanBoneSpecifications.LEFT_RING_INTERMEDIATE,
|
|
63
|
+
"J_Bip_L_Ring3": HumanBoneSpecifications.LEFT_RING_DISTAL,
|
|
64
|
+
"J_Bip_L_Little1": HumanBoneSpecifications.LEFT_LITTLE_PROXIMAL,
|
|
65
|
+
"J_Bip_L_Little2": HumanBoneSpecifications.LEFT_LITTLE_INTERMEDIATE,
|
|
66
|
+
"J_Bip_L_Little3": HumanBoneSpecifications.LEFT_LITTLE_DISTAL,
|
|
67
|
+
"J_Bip_R_Thumb1": HumanBoneSpecifications.RIGHT_THUMB_METACARPAL,
|
|
68
|
+
"J_Bip_R_Thumb2": HumanBoneSpecifications.RIGHT_THUMB_PROXIMAL,
|
|
69
|
+
"J_Bip_R_Thumb3": HumanBoneSpecifications.RIGHT_THUMB_DISTAL,
|
|
70
|
+
"J_Bip_R_Index1": HumanBoneSpecifications.RIGHT_INDEX_PROXIMAL,
|
|
71
|
+
"J_Bip_R_Index2": HumanBoneSpecifications.RIGHT_INDEX_INTERMEDIATE,
|
|
72
|
+
"J_Bip_R_Index3": HumanBoneSpecifications.RIGHT_INDEX_DISTAL,
|
|
73
|
+
"J_Bip_R_Middle1": HumanBoneSpecifications.RIGHT_MIDDLE_PROXIMAL,
|
|
74
|
+
"J_Bip_R_Middle2": HumanBoneSpecifications.RIGHT_MIDDLE_INTERMEDIATE,
|
|
75
|
+
"J_Bip_R_Middle3": HumanBoneSpecifications.RIGHT_MIDDLE_DISTAL,
|
|
76
|
+
"J_Bip_R_Ring1": HumanBoneSpecifications.RIGHT_RING_PROXIMAL,
|
|
77
|
+
"J_Bip_R_Ring2": HumanBoneSpecifications.RIGHT_RING_INTERMEDIATE,
|
|
78
|
+
"J_Bip_R_Ring3": HumanBoneSpecifications.RIGHT_RING_DISTAL,
|
|
79
|
+
"J_Bip_R_Little1": HumanBoneSpecifications.RIGHT_LITTLE_PROXIMAL,
|
|
80
|
+
"J_Bip_R_Little2": HumanBoneSpecifications.RIGHT_LITTLE_INTERMEDIATE,
|
|
81
|
+
"J_Bip_R_Little3": HumanBoneSpecifications.RIGHT_LITTLE_DISTAL,
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
CONFIG: Final = ("VRoid", MAPPING)
|
|
86
|
+
CONFIG_SYMMETRICAL: Final = (
|
|
87
|
+
"VRoid (Symmetrised)",
|
|
88
|
+
{symmetrise_vroid_bone_name(k): v for k, v in MAPPING.items()},
|
|
89
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
"""Legacy glTF shader that existed before version 2.10.5.
|
|
3
|
+
|
|
4
|
+
https://github.com/saturday06/VRM-Addon-for-Blender/tree/2_10_5
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Final
|
|
8
|
+
|
|
9
|
+
TEXTURE_INPUT_NAMES: Final = (
|
|
10
|
+
"color_texture",
|
|
11
|
+
"normal",
|
|
12
|
+
"emissive_texture",
|
|
13
|
+
"occlusion_texture",
|
|
14
|
+
)
|
|
15
|
+
VAL_INPUT_NAMES: Final = ("metallic", "roughness", "unlit")
|
|
16
|
+
RGBA_INPUT_NAMES: Final = ("base_Color", "emissive_color")
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
import logging
|
|
3
|
+
import sys
|
|
4
|
+
import traceback
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from os import environ
|
|
7
|
+
from types import TracebackType
|
|
8
|
+
from typing import TYPE_CHECKING, Optional, Union
|
|
9
|
+
|
|
10
|
+
import bpy
|
|
11
|
+
|
|
12
|
+
# https://github.com/python/typeshed/issues/7855
|
|
13
|
+
if TYPE_CHECKING or sys.version_info >= (3, 11):
|
|
14
|
+
LoggerAdapter = logging.LoggerAdapter[logging.Logger]
|
|
15
|
+
else:
|
|
16
|
+
LoggerAdapter = logging.LoggerAdapter
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class VrmAddonLoggerAdapter(LoggerAdapter):
|
|
20
|
+
def __init__(self, logger: logging.Logger, extra: Mapping[str, object]) -> None:
|
|
21
|
+
super().__init__(logger, extra)
|
|
22
|
+
self._log_output_match_counts: dict[str, int] = {}
|
|
23
|
+
|
|
24
|
+
def register_log_output_match(self, pattern: str) -> None:
|
|
25
|
+
self._log_output_match_counts[pattern] = 0
|
|
26
|
+
|
|
27
|
+
def get_log_output_match_count(self, pattern: str) -> int:
|
|
28
|
+
return self._log_output_match_counts.get(pattern, 0)
|
|
29
|
+
|
|
30
|
+
def clear_log_output_match_count(self) -> None:
|
|
31
|
+
self._log_output_match_counts.clear()
|
|
32
|
+
|
|
33
|
+
def log(
|
|
34
|
+
self,
|
|
35
|
+
level: int,
|
|
36
|
+
msg: object,
|
|
37
|
+
*args: object,
|
|
38
|
+
exc_info: Union[
|
|
39
|
+
bool,
|
|
40
|
+
Union[
|
|
41
|
+
tuple[type[BaseException], BaseException, Optional[TracebackType]],
|
|
42
|
+
tuple[None, None, None],
|
|
43
|
+
],
|
|
44
|
+
BaseException,
|
|
45
|
+
None,
|
|
46
|
+
] = None,
|
|
47
|
+
stack_info: bool = False,
|
|
48
|
+
stacklevel: int = 1,
|
|
49
|
+
extra: Optional[Mapping[str, object]] = None,
|
|
50
|
+
**kwargs: object,
|
|
51
|
+
) -> None:
|
|
52
|
+
level_name = logging.getLevelName(level)
|
|
53
|
+
if self._log_output_match_counts:
|
|
54
|
+
try:
|
|
55
|
+
formatted_message = str(msg) % args if args else str(msg)
|
|
56
|
+
except (TypeError, ValueError):
|
|
57
|
+
formatted_message = str(msg)
|
|
58
|
+
if exc_info is True:
|
|
59
|
+
formatted_message += f"\n{traceback.format_exc()}"
|
|
60
|
+
elif exc_info:
|
|
61
|
+
formatted_message += f"\n{exc_info}"
|
|
62
|
+
for pattern, match_count in self._log_output_match_counts.items():
|
|
63
|
+
if pattern in formatted_message:
|
|
64
|
+
self._log_output_match_counts[pattern] = match_count + 1
|
|
65
|
+
super().log(
|
|
66
|
+
level,
|
|
67
|
+
f"[VRM Add-on:{level_name}] {msg}",
|
|
68
|
+
*args,
|
|
69
|
+
exc_info=exc_info,
|
|
70
|
+
stack_info=stack_info,
|
|
71
|
+
stacklevel=stacklevel,
|
|
72
|
+
extra=extra,
|
|
73
|
+
**kwargs,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# https://docs.python.org/3.7/library/logging.html#logging.getLogger
|
|
78
|
+
def get_logger(name: str) -> VrmAddonLoggerAdapter:
|
|
79
|
+
logger = logging.getLogger(name)
|
|
80
|
+
if bpy.app.debug or environ.get("BLENDER_VRM_LOGGING_LEVEL_DEBUG") == "yes":
|
|
81
|
+
logger.setLevel(min(logging.DEBUG, logger.getEffectiveLevel()))
|
|
82
|
+
else:
|
|
83
|
+
logger.setLevel(max(logging.INFO, logger.getEffectiveLevel()))
|
|
84
|
+
return VrmAddonLoggerAdapter(logger, {})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import ClassVar, Optional
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class MtoonUnversioned:
|
|
7
|
+
# {key = MToonProp, val = ShaderNodeGroup_member_name}
|
|
8
|
+
version = 32
|
|
9
|
+
float_props_exchange_dict: Mapping[str, Optional[str]] = {
|
|
10
|
+
"_MToonVersion": None,
|
|
11
|
+
"_Cutoff": "CutoffRate",
|
|
12
|
+
"_BumpScale": "BumpScale",
|
|
13
|
+
"_ReceiveShadowRate": "ReceiveShadowRate",
|
|
14
|
+
"_ShadeShift": "ShadeShift",
|
|
15
|
+
"_ShadeToony": "ShadeToony",
|
|
16
|
+
"_RimLightingMix": "RimLightingMix",
|
|
17
|
+
"_RimFresnelPower": "RimFresnelPower",
|
|
18
|
+
"_RimLift": "RimLift",
|
|
19
|
+
"_ShadingGradeRate": "ShadingGradeRate",
|
|
20
|
+
"_LightColorAttenuation": "LightColorAttenuation",
|
|
21
|
+
"_IndirectLightIntensity": "IndirectLightIntensity",
|
|
22
|
+
"_OutlineWidth": "OutlineWidth",
|
|
23
|
+
"_OutlineScaledMaxDistance": "OutlineScaleMaxDistance",
|
|
24
|
+
"_OutlineLightingMix": "OutlineLightingMix",
|
|
25
|
+
"_UvAnimScrollX": "UV_Scroll_X",
|
|
26
|
+
"_UvAnimScrollY": "UV_Scroll_Y",
|
|
27
|
+
"_UvAnimRotation": "UV_Scroll_Rotation",
|
|
28
|
+
"_DebugMode": None,
|
|
29
|
+
"_BlendMode": None,
|
|
30
|
+
"_OutlineWidthMode": "OutlineWidthMode",
|
|
31
|
+
"_OutlineColorMode": "OutlineColorMode",
|
|
32
|
+
"_CullMode": None,
|
|
33
|
+
"_OutlineCullMode": None,
|
|
34
|
+
"_SrcBlend": None,
|
|
35
|
+
"_DstBlend": None,
|
|
36
|
+
"_ZWrite": None,
|
|
37
|
+
"_IsFirstSetup": None,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
texture_kind_exchange_dict: Mapping[str, str] = {
|
|
41
|
+
"_MainTex": "MainTexture",
|
|
42
|
+
"_ShadeTexture": "ShadeTexture",
|
|
43
|
+
"_BumpMap": "NormalmapTexture",
|
|
44
|
+
"_ReceiveShadowTexture": "ReceiveShadow_Texture",
|
|
45
|
+
"_ShadingGradeTexture": "ShadingGradeTexture",
|
|
46
|
+
"_EmissionMap": "Emission_Texture",
|
|
47
|
+
"_SphereAdd": "SphereAddTexture",
|
|
48
|
+
"_RimTexture": "RimTexture",
|
|
49
|
+
"_OutlineWidthTexture": "OutlineWidthTexture",
|
|
50
|
+
"_UvAnimMaskTexture": "UV_Animation_Mask_Texture",
|
|
51
|
+
}
|
|
52
|
+
vector_base_props_exchange_dict: Mapping[str, str] = {
|
|
53
|
+
"_Color": "DiffuseColor",
|
|
54
|
+
"_ShadeColor": "ShadeColor",
|
|
55
|
+
"_EmissionColor": "EmissionColor",
|
|
56
|
+
"_RimColor": "RimColor",
|
|
57
|
+
"_OutlineColor": "OutlineColor",
|
|
58
|
+
}
|
|
59
|
+
# texture offset and scaling props by texture
|
|
60
|
+
vector_props_exchange_dict: ClassVar[dict[str, str]] = {}
|
|
61
|
+
vector_props_exchange_dict.update(vector_base_props_exchange_dict)
|
|
62
|
+
vector_props_exchange_dict.update(texture_kind_exchange_dict)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# This code is auto generated.
|
|
2
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
3
|
+
|
|
4
|
+
from collections.abc import Mapping, Sequence
|
|
5
|
+
from typing import Optional, Union
|
|
6
|
+
|
|
7
|
+
import bpy
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# This code is auto generated.
|
|
11
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
12
|
+
def vrm(
|
|
13
|
+
execution_context: str = "EXEC_DEFAULT",
|
|
14
|
+
/,
|
|
15
|
+
*,
|
|
16
|
+
filter_glob: str = "*.vrm",
|
|
17
|
+
use_addon_preferences: bool = False,
|
|
18
|
+
export_invisibles: bool = False,
|
|
19
|
+
export_only_selections: bool = False,
|
|
20
|
+
enable_advanced_preferences: bool = False,
|
|
21
|
+
export_all_influences: bool = False,
|
|
22
|
+
export_lights: bool = False,
|
|
23
|
+
export_gltf_animations: bool = False,
|
|
24
|
+
export_try_sparse_sk: bool = False,
|
|
25
|
+
errors: Optional[Sequence[Mapping[str, Union[str, int, float, bool]]]] = None,
|
|
26
|
+
armature_object_name: str = "",
|
|
27
|
+
ignore_warning: bool = False,
|
|
28
|
+
filepath: str = "",
|
|
29
|
+
check_existing: bool = True,
|
|
30
|
+
) -> set[str]:
|
|
31
|
+
return bpy.ops.export_scene.vrm( # type: ignore[attr-defined, no-any-return]
|
|
32
|
+
execution_context,
|
|
33
|
+
filter_glob=filter_glob,
|
|
34
|
+
use_addon_preferences=use_addon_preferences,
|
|
35
|
+
export_invisibles=export_invisibles,
|
|
36
|
+
export_only_selections=export_only_selections,
|
|
37
|
+
enable_advanced_preferences=enable_advanced_preferences,
|
|
38
|
+
export_all_influences=export_all_influences,
|
|
39
|
+
export_lights=export_lights,
|
|
40
|
+
export_gltf_animations=export_gltf_animations,
|
|
41
|
+
export_try_sparse_sk=export_try_sparse_sk,
|
|
42
|
+
errors=errors if errors is not None else [],
|
|
43
|
+
armature_object_name=armature_object_name,
|
|
44
|
+
ignore_warning=ignore_warning,
|
|
45
|
+
filepath=filepath,
|
|
46
|
+
check_existing=check_existing,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# This code is auto generated.
|
|
51
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
52
|
+
def vrma(
|
|
53
|
+
execution_context: str = "EXEC_DEFAULT",
|
|
54
|
+
/,
|
|
55
|
+
*,
|
|
56
|
+
filter_glob: str = "*.vrma",
|
|
57
|
+
armature_object_name: str = "",
|
|
58
|
+
filepath: str = "",
|
|
59
|
+
check_existing: bool = True,
|
|
60
|
+
) -> set[str]:
|
|
61
|
+
return bpy.ops.export_scene.vrma( # type: ignore[attr-defined, no-any-return]
|
|
62
|
+
execution_context,
|
|
63
|
+
filter_glob=filter_glob,
|
|
64
|
+
armature_object_name=armature_object_name,
|
|
65
|
+
filepath=filepath,
|
|
66
|
+
check_existing=check_existing,
|
|
67
|
+
)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# This code is auto generated.
|
|
2
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import bpy
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# This code is auto generated.
|
|
9
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
10
|
+
def make_basic_armature(
|
|
11
|
+
execution_context: str = "EXEC_DEFAULT",
|
|
12
|
+
/,
|
|
13
|
+
*,
|
|
14
|
+
skip_heavy_armature_setup: bool = False,
|
|
15
|
+
wip_with_template_mesh: bool = False,
|
|
16
|
+
tall: float = 1.7,
|
|
17
|
+
head_ratio: float = 8.0,
|
|
18
|
+
head_width_ratio: float = 0.6666666666666666,
|
|
19
|
+
aging_ratio: float = 0.5,
|
|
20
|
+
eye_depth: float = -0.03,
|
|
21
|
+
shoulder_in_width: float = 0.05,
|
|
22
|
+
shoulder_width: float = 0.08,
|
|
23
|
+
arm_length_ratio: float = 1,
|
|
24
|
+
hand_ratio: float = 1,
|
|
25
|
+
finger_1_2_ratio: float = 0.75,
|
|
26
|
+
finger_2_3_ratio: float = 0.75,
|
|
27
|
+
nail_bone: bool = False,
|
|
28
|
+
leg_length_ratio: float = 0.5,
|
|
29
|
+
leg_width_ratio: float = 1,
|
|
30
|
+
leg_size: float = 0.26,
|
|
31
|
+
custom_property_name: str = "",
|
|
32
|
+
) -> set[str]:
|
|
33
|
+
return bpy.ops.icyp.make_basic_armature( # type: ignore[attr-defined, no-any-return]
|
|
34
|
+
execution_context,
|
|
35
|
+
skip_heavy_armature_setup=skip_heavy_armature_setup,
|
|
36
|
+
wip_with_template_mesh=wip_with_template_mesh,
|
|
37
|
+
tall=tall,
|
|
38
|
+
head_ratio=head_ratio,
|
|
39
|
+
head_width_ratio=head_width_ratio,
|
|
40
|
+
aging_ratio=aging_ratio,
|
|
41
|
+
eye_depth=eye_depth,
|
|
42
|
+
shoulder_in_width=shoulder_in_width,
|
|
43
|
+
shoulder_width=shoulder_width,
|
|
44
|
+
arm_length_ratio=arm_length_ratio,
|
|
45
|
+
hand_ratio=hand_ratio,
|
|
46
|
+
finger_1_2_ratio=finger_1_2_ratio,
|
|
47
|
+
finger_2_3_ratio=finger_2_3_ratio,
|
|
48
|
+
nail_bone=nail_bone,
|
|
49
|
+
leg_length_ratio=leg_length_ratio,
|
|
50
|
+
leg_width_ratio=leg_width_ratio,
|
|
51
|
+
leg_size=leg_size,
|
|
52
|
+
custom_property_name=custom_property_name,
|
|
53
|
+
)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# This code is auto generated.
|
|
2
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import bpy
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# This code is auto generated.
|
|
9
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
10
|
+
def vrm(
|
|
11
|
+
execution_context: str = "EXEC_DEFAULT",
|
|
12
|
+
/,
|
|
13
|
+
*,
|
|
14
|
+
filter_glob: str = "*.vrm",
|
|
15
|
+
use_addon_preferences: bool = False,
|
|
16
|
+
extract_textures_into_folder: bool = False,
|
|
17
|
+
make_new_texture_folder: bool = True,
|
|
18
|
+
set_shading_type_to_material_on_import: bool = True,
|
|
19
|
+
set_view_transform_to_standard_on_import: bool = True,
|
|
20
|
+
set_armature_display_to_wire: bool = True,
|
|
21
|
+
set_armature_display_to_show_in_front: bool = True,
|
|
22
|
+
set_armature_bone_shape_to_default: bool = True,
|
|
23
|
+
enable_mtoon_outline_preview: bool = True,
|
|
24
|
+
filepath: str = "",
|
|
25
|
+
) -> set[str]:
|
|
26
|
+
return bpy.ops.import_scene.vrm( # type: ignore[attr-defined, no-any-return]
|
|
27
|
+
execution_context,
|
|
28
|
+
filter_glob=filter_glob,
|
|
29
|
+
use_addon_preferences=use_addon_preferences,
|
|
30
|
+
extract_textures_into_folder=extract_textures_into_folder,
|
|
31
|
+
make_new_texture_folder=make_new_texture_folder,
|
|
32
|
+
set_shading_type_to_material_on_import=set_shading_type_to_material_on_import,
|
|
33
|
+
set_view_transform_to_standard_on_import=set_view_transform_to_standard_on_import,
|
|
34
|
+
set_armature_display_to_wire=set_armature_display_to_wire,
|
|
35
|
+
set_armature_display_to_show_in_front=set_armature_display_to_show_in_front,
|
|
36
|
+
set_armature_bone_shape_to_default=set_armature_bone_shape_to_default,
|
|
37
|
+
enable_mtoon_outline_preview=enable_mtoon_outline_preview,
|
|
38
|
+
filepath=filepath,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# This code is auto generated.
|
|
43
|
+
# To regenerate, run the `uv run tools/property_typing.py` command.
|
|
44
|
+
def vrma(
|
|
45
|
+
execution_context: str = "EXEC_DEFAULT",
|
|
46
|
+
/,
|
|
47
|
+
*,
|
|
48
|
+
filter_glob: str = "*.vrma",
|
|
49
|
+
armature_object_name: str = "",
|
|
50
|
+
filepath: str = "",
|
|
51
|
+
) -> set[str]:
|
|
52
|
+
return bpy.ops.import_scene.vrma( # type: ignore[attr-defined, no-any-return]
|
|
53
|
+
execution_context,
|
|
54
|
+
filter_glob=filter_glob,
|
|
55
|
+
armature_object_name=armature_object_name,
|
|
56
|
+
filepath=filepath,
|
|
57
|
+
)
|