@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,662 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
|
|
2
|
+
# SPDX-FileCopyrightText: 2018 iCyP
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
from collections.abc import Mapping
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from functools import cached_property
|
|
9
|
+
from typing import ClassVar, Final, Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# https://github.com/vrm-c/vrm-specification/tree/b5793b4ca250ed3acbde3dd7a47ee9ee1b3d60e9/specification/0.0#vrm-extension-models-bone-mapping-jsonextensionsvrmhumanoid
|
|
13
|
+
class HumanBoneName(Enum):
|
|
14
|
+
# Torso
|
|
15
|
+
HIPS = "hips"
|
|
16
|
+
SPINE = "spine"
|
|
17
|
+
CHEST = "chest"
|
|
18
|
+
UPPER_CHEST = "upperChest"
|
|
19
|
+
NECK = "neck"
|
|
20
|
+
|
|
21
|
+
# Head
|
|
22
|
+
HEAD = "head"
|
|
23
|
+
LEFT_EYE = "leftEye"
|
|
24
|
+
RIGHT_EYE = "rightEye"
|
|
25
|
+
JAW = "jaw"
|
|
26
|
+
|
|
27
|
+
# Leg
|
|
28
|
+
LEFT_UPPER_LEG = "leftUpperLeg"
|
|
29
|
+
LEFT_LOWER_LEG = "leftLowerLeg"
|
|
30
|
+
LEFT_FOOT = "leftFoot"
|
|
31
|
+
LEFT_TOES = "leftToes"
|
|
32
|
+
RIGHT_UPPER_LEG = "rightUpperLeg"
|
|
33
|
+
RIGHT_LOWER_LEG = "rightLowerLeg"
|
|
34
|
+
RIGHT_FOOT = "rightFoot"
|
|
35
|
+
RIGHT_TOES = "rightToes"
|
|
36
|
+
|
|
37
|
+
# Arm
|
|
38
|
+
LEFT_SHOULDER = "leftShoulder"
|
|
39
|
+
LEFT_UPPER_ARM = "leftUpperArm"
|
|
40
|
+
LEFT_LOWER_ARM = "leftLowerArm"
|
|
41
|
+
LEFT_HAND = "leftHand"
|
|
42
|
+
RIGHT_SHOULDER = "rightShoulder"
|
|
43
|
+
RIGHT_UPPER_ARM = "rightUpperArm"
|
|
44
|
+
RIGHT_LOWER_ARM = "rightLowerArm"
|
|
45
|
+
RIGHT_HAND = "rightHand"
|
|
46
|
+
|
|
47
|
+
# Finger
|
|
48
|
+
LEFT_THUMB_PROXIMAL = "leftThumbProximal"
|
|
49
|
+
LEFT_THUMB_INTERMEDIATE = "leftThumbIntermediate"
|
|
50
|
+
LEFT_THUMB_DISTAL = "leftThumbDistal"
|
|
51
|
+
LEFT_INDEX_PROXIMAL = "leftIndexProximal"
|
|
52
|
+
LEFT_INDEX_INTERMEDIATE = "leftIndexIntermediate"
|
|
53
|
+
LEFT_INDEX_DISTAL = "leftIndexDistal"
|
|
54
|
+
LEFT_MIDDLE_PROXIMAL = "leftMiddleProximal"
|
|
55
|
+
LEFT_MIDDLE_INTERMEDIATE = "leftMiddleIntermediate"
|
|
56
|
+
LEFT_MIDDLE_DISTAL = "leftMiddleDistal"
|
|
57
|
+
LEFT_RING_PROXIMAL = "leftRingProximal"
|
|
58
|
+
LEFT_RING_INTERMEDIATE = "leftRingIntermediate"
|
|
59
|
+
LEFT_RING_DISTAL = "leftRingDistal"
|
|
60
|
+
LEFT_LITTLE_PROXIMAL = "leftLittleProximal"
|
|
61
|
+
LEFT_LITTLE_INTERMEDIATE = "leftLittleIntermediate"
|
|
62
|
+
LEFT_LITTLE_DISTAL = "leftLittleDistal"
|
|
63
|
+
RIGHT_THUMB_PROXIMAL = "rightThumbProximal"
|
|
64
|
+
RIGHT_THUMB_INTERMEDIATE = "rightThumbIntermediate"
|
|
65
|
+
RIGHT_THUMB_DISTAL = "rightThumbDistal"
|
|
66
|
+
RIGHT_INDEX_PROXIMAL = "rightIndexProximal"
|
|
67
|
+
RIGHT_INDEX_INTERMEDIATE = "rightIndexIntermediate"
|
|
68
|
+
RIGHT_INDEX_DISTAL = "rightIndexDistal"
|
|
69
|
+
RIGHT_MIDDLE_PROXIMAL = "rightMiddleProximal"
|
|
70
|
+
RIGHT_MIDDLE_INTERMEDIATE = "rightMiddleIntermediate"
|
|
71
|
+
RIGHT_MIDDLE_DISTAL = "rightMiddleDistal"
|
|
72
|
+
RIGHT_RING_PROXIMAL = "rightRingProximal"
|
|
73
|
+
RIGHT_RING_INTERMEDIATE = "rightRingIntermediate"
|
|
74
|
+
RIGHT_RING_DISTAL = "rightRingDistal"
|
|
75
|
+
RIGHT_LITTLE_PROXIMAL = "rightLittleProximal"
|
|
76
|
+
RIGHT_LITTLE_INTERMEDIATE = "rightLittleIntermediate"
|
|
77
|
+
RIGHT_LITTLE_DISTAL = "rightLittleDistal"
|
|
78
|
+
|
|
79
|
+
@staticmethod
|
|
80
|
+
def from_str(human_bone_name_str: str) -> Optional["HumanBoneName"]:
|
|
81
|
+
try:
|
|
82
|
+
return HumanBoneName(human_bone_name_str)
|
|
83
|
+
except ValueError:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# https://github.com/vrm-c/vrm.dev/blob/cd1d367417c53ba0f1d46588180c17b5e2768e22/docs/univrm/humanoid/humanoid_overview.md?plain=1#L99-L106
|
|
88
|
+
HumanBoneStructure = Mapping[HumanBoneName, "HumanBoneStructure"]
|
|
89
|
+
HUMAN_BONE_STRUCTURE: Final[HumanBoneStructure] = {
|
|
90
|
+
HumanBoneName.HIPS: {
|
|
91
|
+
HumanBoneName.SPINE: {
|
|
92
|
+
HumanBoneName.CHEST: {
|
|
93
|
+
HumanBoneName.UPPER_CHEST: {
|
|
94
|
+
HumanBoneName.NECK: {
|
|
95
|
+
HumanBoneName.HEAD: {
|
|
96
|
+
HumanBoneName.LEFT_EYE: {},
|
|
97
|
+
HumanBoneName.RIGHT_EYE: {},
|
|
98
|
+
HumanBoneName.JAW: {},
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
HumanBoneName.LEFT_SHOULDER: {
|
|
102
|
+
HumanBoneName.LEFT_UPPER_ARM: {
|
|
103
|
+
HumanBoneName.LEFT_LOWER_ARM: {
|
|
104
|
+
HumanBoneName.LEFT_HAND: {
|
|
105
|
+
HumanBoneName.LEFT_THUMB_PROXIMAL: {
|
|
106
|
+
HumanBoneName.LEFT_THUMB_INTERMEDIATE: {
|
|
107
|
+
HumanBoneName.LEFT_THUMB_DISTAL: {}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
HumanBoneName.LEFT_INDEX_PROXIMAL: {
|
|
111
|
+
HumanBoneName.LEFT_INDEX_INTERMEDIATE: {
|
|
112
|
+
HumanBoneName.LEFT_INDEX_DISTAL: {}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
HumanBoneName.LEFT_MIDDLE_PROXIMAL: {
|
|
116
|
+
HumanBoneName.LEFT_MIDDLE_INTERMEDIATE: {
|
|
117
|
+
HumanBoneName.LEFT_MIDDLE_DISTAL: {}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
HumanBoneName.LEFT_RING_PROXIMAL: {
|
|
121
|
+
HumanBoneName.LEFT_RING_INTERMEDIATE: {
|
|
122
|
+
HumanBoneName.LEFT_RING_DISTAL: {}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
HumanBoneName.LEFT_LITTLE_PROXIMAL: {
|
|
126
|
+
HumanBoneName.LEFT_LITTLE_INTERMEDIATE: {
|
|
127
|
+
HumanBoneName.LEFT_LITTLE_DISTAL: {}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
HumanBoneName.RIGHT_SHOULDER: {
|
|
135
|
+
HumanBoneName.RIGHT_UPPER_ARM: {
|
|
136
|
+
HumanBoneName.RIGHT_LOWER_ARM: {
|
|
137
|
+
HumanBoneName.RIGHT_HAND: {
|
|
138
|
+
HumanBoneName.RIGHT_THUMB_PROXIMAL: {
|
|
139
|
+
HumanBoneName.RIGHT_THUMB_INTERMEDIATE: {
|
|
140
|
+
HumanBoneName.RIGHT_THUMB_DISTAL: {}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
HumanBoneName.RIGHT_INDEX_PROXIMAL: {
|
|
144
|
+
HumanBoneName.RIGHT_INDEX_INTERMEDIATE: {
|
|
145
|
+
HumanBoneName.RIGHT_INDEX_DISTAL: {}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
HumanBoneName.RIGHT_MIDDLE_PROXIMAL: {
|
|
149
|
+
HumanBoneName.RIGHT_MIDDLE_INTERMEDIATE: {
|
|
150
|
+
HumanBoneName.RIGHT_MIDDLE_DISTAL: {}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
HumanBoneName.RIGHT_RING_PROXIMAL: {
|
|
154
|
+
HumanBoneName.RIGHT_RING_INTERMEDIATE: {
|
|
155
|
+
HumanBoneName.RIGHT_RING_DISTAL: {}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
HumanBoneName.RIGHT_LITTLE_PROXIMAL: {
|
|
159
|
+
HumanBoneName.RIGHT_LITTLE_INTERMEDIATE: {
|
|
160
|
+
HumanBoneName.RIGHT_LITTLE_DISTAL: {}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
HumanBoneName.LEFT_UPPER_LEG: {
|
|
171
|
+
HumanBoneName.LEFT_LOWER_LEG: {
|
|
172
|
+
HumanBoneName.LEFT_FOOT: {HumanBoneName.LEFT_TOES: {}}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
HumanBoneName.RIGHT_UPPER_LEG: {
|
|
176
|
+
HumanBoneName.RIGHT_LOWER_LEG: {
|
|
177
|
+
HumanBoneName.RIGHT_FOOT: {HumanBoneName.RIGHT_TOES: {}}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@dataclass(frozen=True)
|
|
185
|
+
class HumanBoneSpecification:
|
|
186
|
+
name: HumanBoneName
|
|
187
|
+
icon: str
|
|
188
|
+
title: str
|
|
189
|
+
label: str
|
|
190
|
+
label_no_left_right: str
|
|
191
|
+
requirement: bool
|
|
192
|
+
parent_name: Optional[HumanBoneName]
|
|
193
|
+
children_names: tuple[HumanBoneName, ...]
|
|
194
|
+
|
|
195
|
+
@cached_property
|
|
196
|
+
def parent(self) -> Optional["HumanBoneSpecification"]:
|
|
197
|
+
if self.parent_name is None:
|
|
198
|
+
return None
|
|
199
|
+
return HumanBoneSpecifications.get(self.parent_name)
|
|
200
|
+
|
|
201
|
+
@cached_property
|
|
202
|
+
def children(self) -> tuple["HumanBoneSpecification", ...]:
|
|
203
|
+
return tuple(map(HumanBoneSpecifications.get, self.children_names))
|
|
204
|
+
|
|
205
|
+
@cached_property
|
|
206
|
+
def descendants(self) -> tuple["HumanBoneSpecification", ...]:
|
|
207
|
+
result: list[HumanBoneSpecification] = []
|
|
208
|
+
searching_children = list(self.children)
|
|
209
|
+
while searching_children:
|
|
210
|
+
child = searching_children.pop()
|
|
211
|
+
result.append(child)
|
|
212
|
+
searching_children.extend(child.children)
|
|
213
|
+
return tuple(result)
|
|
214
|
+
|
|
215
|
+
@staticmethod
|
|
216
|
+
def create(
|
|
217
|
+
human_bone_name: HumanBoneName, *, requirement: bool, icon: str
|
|
218
|
+
) -> "HumanBoneSpecification":
|
|
219
|
+
# https://stackoverflow.com/a/1176023
|
|
220
|
+
words = re.sub(r"(?<!^)(?=[A-Z])", "#", human_bone_name.value).split("#")
|
|
221
|
+
title = " ".join(word.capitalize() for word in words)
|
|
222
|
+
label = title + ":"
|
|
223
|
+
label_no_left_right = re.sub(r"Right ", "", re.sub(r"^Left ", "", label))
|
|
224
|
+
|
|
225
|
+
return HumanBoneSpecification(
|
|
226
|
+
name=human_bone_name,
|
|
227
|
+
icon=icon,
|
|
228
|
+
title=title,
|
|
229
|
+
label=label,
|
|
230
|
+
label_no_left_right=label_no_left_right,
|
|
231
|
+
requirement=requirement,
|
|
232
|
+
parent_name=HumanBoneSpecification._find_parent_human_bone_name(
|
|
233
|
+
human_bone_name, None, HUMAN_BONE_STRUCTURE
|
|
234
|
+
),
|
|
235
|
+
children_names=HumanBoneSpecification._find_children_human_bone_names(
|
|
236
|
+
human_bone_name, HUMAN_BONE_STRUCTURE
|
|
237
|
+
),
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
@staticmethod
|
|
241
|
+
def _find_parent_human_bone_name(
|
|
242
|
+
child_human_bone_name: HumanBoneName,
|
|
243
|
+
parent_human_bone_name: Optional[HumanBoneName],
|
|
244
|
+
human_bone_structure: HumanBoneStructure,
|
|
245
|
+
) -> Optional[HumanBoneName]:
|
|
246
|
+
for (
|
|
247
|
+
next_human_bone_name,
|
|
248
|
+
next_human_bone_structure,
|
|
249
|
+
) in human_bone_structure.items():
|
|
250
|
+
if child_human_bone_name == next_human_bone_name:
|
|
251
|
+
return parent_human_bone_name
|
|
252
|
+
|
|
253
|
+
name = HumanBoneSpecification._find_parent_human_bone_name(
|
|
254
|
+
child_human_bone_name, next_human_bone_name, next_human_bone_structure
|
|
255
|
+
)
|
|
256
|
+
if name:
|
|
257
|
+
return name
|
|
258
|
+
|
|
259
|
+
return None
|
|
260
|
+
|
|
261
|
+
@staticmethod
|
|
262
|
+
def _find_children_human_bone_names(
|
|
263
|
+
human_bone_name: HumanBoneName,
|
|
264
|
+
human_bone_structure: HumanBoneStructure,
|
|
265
|
+
) -> tuple[HumanBoneName, ...]:
|
|
266
|
+
for (
|
|
267
|
+
next_human_bone_name,
|
|
268
|
+
next_human_bone_structure,
|
|
269
|
+
) in human_bone_structure.items():
|
|
270
|
+
if human_bone_name == next_human_bone_name:
|
|
271
|
+
return tuple(next_human_bone_structure.keys())
|
|
272
|
+
|
|
273
|
+
children = HumanBoneSpecification._find_children_human_bone_names(
|
|
274
|
+
human_bone_name, next_human_bone_structure
|
|
275
|
+
)
|
|
276
|
+
if children:
|
|
277
|
+
return children
|
|
278
|
+
|
|
279
|
+
return ()
|
|
280
|
+
|
|
281
|
+
def is_ancestor_of(
|
|
282
|
+
self, human_bone_specification: "HumanBoneSpecification"
|
|
283
|
+
) -> bool:
|
|
284
|
+
parent = human_bone_specification.parent
|
|
285
|
+
while parent:
|
|
286
|
+
if parent == self:
|
|
287
|
+
return True
|
|
288
|
+
parent = parent.parent
|
|
289
|
+
return False
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def _create_and_append_human_bone_specification(
|
|
293
|
+
human_bone_specifications: list[HumanBoneSpecification],
|
|
294
|
+
human_bone_name: HumanBoneName,
|
|
295
|
+
*,
|
|
296
|
+
requirement: bool,
|
|
297
|
+
icon: str,
|
|
298
|
+
) -> HumanBoneSpecification:
|
|
299
|
+
human_bone_specification = HumanBoneSpecification.create(
|
|
300
|
+
human_bone_name, requirement=requirement, icon=icon
|
|
301
|
+
)
|
|
302
|
+
human_bone_specifications.append(human_bone_specification)
|
|
303
|
+
return human_bone_specification
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class HumanBoneSpecifications:
|
|
307
|
+
all_human_bones: ClassVar[list[HumanBoneSpecification]] = []
|
|
308
|
+
|
|
309
|
+
# https://github.com/vrm-c/vrm-specification/tree/b5793b4ca250ed3acbde3dd7a47ee9ee1b3d60e9/specification/0.0#vrm-extension-models-bone-mapping-jsonextensionsvrmhumanoid
|
|
310
|
+
# Torso
|
|
311
|
+
HIPS = _create_and_append_human_bone_specification(
|
|
312
|
+
all_human_bones,
|
|
313
|
+
HumanBoneName.HIPS,
|
|
314
|
+
requirement=True,
|
|
315
|
+
icon="USER",
|
|
316
|
+
)
|
|
317
|
+
SPINE = _create_and_append_human_bone_specification(
|
|
318
|
+
all_human_bones,
|
|
319
|
+
HumanBoneName.SPINE,
|
|
320
|
+
requirement=True,
|
|
321
|
+
icon="USER",
|
|
322
|
+
)
|
|
323
|
+
CHEST = _create_and_append_human_bone_specification(
|
|
324
|
+
all_human_bones,
|
|
325
|
+
HumanBoneName.CHEST,
|
|
326
|
+
requirement=True,
|
|
327
|
+
icon="USER",
|
|
328
|
+
)
|
|
329
|
+
UPPER_CHEST = _create_and_append_human_bone_specification(
|
|
330
|
+
all_human_bones,
|
|
331
|
+
HumanBoneName.UPPER_CHEST,
|
|
332
|
+
requirement=False,
|
|
333
|
+
icon="USER",
|
|
334
|
+
)
|
|
335
|
+
NECK = _create_and_append_human_bone_specification(
|
|
336
|
+
all_human_bones,
|
|
337
|
+
HumanBoneName.NECK,
|
|
338
|
+
requirement=True,
|
|
339
|
+
icon="USER",
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
# Head
|
|
343
|
+
HEAD = _create_and_append_human_bone_specification(
|
|
344
|
+
all_human_bones,
|
|
345
|
+
HumanBoneName.HEAD,
|
|
346
|
+
requirement=True,
|
|
347
|
+
icon="USER",
|
|
348
|
+
)
|
|
349
|
+
LEFT_EYE = _create_and_append_human_bone_specification(
|
|
350
|
+
all_human_bones,
|
|
351
|
+
HumanBoneName.LEFT_EYE,
|
|
352
|
+
requirement=False,
|
|
353
|
+
icon="HIDE_OFF",
|
|
354
|
+
)
|
|
355
|
+
RIGHT_EYE = _create_and_append_human_bone_specification(
|
|
356
|
+
all_human_bones,
|
|
357
|
+
HumanBoneName.RIGHT_EYE,
|
|
358
|
+
requirement=False,
|
|
359
|
+
icon="HIDE_OFF",
|
|
360
|
+
)
|
|
361
|
+
JAW = _create_and_append_human_bone_specification(
|
|
362
|
+
all_human_bones,
|
|
363
|
+
HumanBoneName.JAW,
|
|
364
|
+
requirement=False,
|
|
365
|
+
icon="USER",
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
# Leg
|
|
369
|
+
LEFT_UPPER_LEG = _create_and_append_human_bone_specification(
|
|
370
|
+
all_human_bones,
|
|
371
|
+
HumanBoneName.LEFT_UPPER_LEG,
|
|
372
|
+
requirement=True,
|
|
373
|
+
icon="MOD_DYNAMICPAINT",
|
|
374
|
+
)
|
|
375
|
+
LEFT_LOWER_LEG = _create_and_append_human_bone_specification(
|
|
376
|
+
all_human_bones,
|
|
377
|
+
HumanBoneName.LEFT_LOWER_LEG,
|
|
378
|
+
requirement=True,
|
|
379
|
+
icon="MOD_DYNAMICPAINT",
|
|
380
|
+
)
|
|
381
|
+
LEFT_FOOT = _create_and_append_human_bone_specification(
|
|
382
|
+
all_human_bones,
|
|
383
|
+
HumanBoneName.LEFT_FOOT,
|
|
384
|
+
requirement=True,
|
|
385
|
+
icon="MOD_DYNAMICPAINT",
|
|
386
|
+
)
|
|
387
|
+
LEFT_TOES = _create_and_append_human_bone_specification(
|
|
388
|
+
all_human_bones,
|
|
389
|
+
HumanBoneName.LEFT_TOES,
|
|
390
|
+
requirement=False,
|
|
391
|
+
icon="MOD_DYNAMICPAINT",
|
|
392
|
+
)
|
|
393
|
+
RIGHT_UPPER_LEG = _create_and_append_human_bone_specification(
|
|
394
|
+
all_human_bones,
|
|
395
|
+
HumanBoneName.RIGHT_UPPER_LEG,
|
|
396
|
+
requirement=True,
|
|
397
|
+
icon="MOD_DYNAMICPAINT",
|
|
398
|
+
)
|
|
399
|
+
RIGHT_LOWER_LEG = _create_and_append_human_bone_specification(
|
|
400
|
+
all_human_bones,
|
|
401
|
+
HumanBoneName.RIGHT_LOWER_LEG,
|
|
402
|
+
requirement=True,
|
|
403
|
+
icon="MOD_DYNAMICPAINT",
|
|
404
|
+
)
|
|
405
|
+
RIGHT_FOOT = _create_and_append_human_bone_specification(
|
|
406
|
+
all_human_bones,
|
|
407
|
+
HumanBoneName.RIGHT_FOOT,
|
|
408
|
+
requirement=True,
|
|
409
|
+
icon="MOD_DYNAMICPAINT",
|
|
410
|
+
)
|
|
411
|
+
RIGHT_TOES = _create_and_append_human_bone_specification(
|
|
412
|
+
all_human_bones,
|
|
413
|
+
HumanBoneName.RIGHT_TOES,
|
|
414
|
+
requirement=False,
|
|
415
|
+
icon="MOD_DYNAMICPAINT",
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
# Arm
|
|
419
|
+
LEFT_SHOULDER = _create_and_append_human_bone_specification(
|
|
420
|
+
all_human_bones,
|
|
421
|
+
HumanBoneName.LEFT_SHOULDER,
|
|
422
|
+
requirement=False,
|
|
423
|
+
icon="VIEW_PAN",
|
|
424
|
+
)
|
|
425
|
+
LEFT_UPPER_ARM = _create_and_append_human_bone_specification(
|
|
426
|
+
all_human_bones,
|
|
427
|
+
HumanBoneName.LEFT_UPPER_ARM,
|
|
428
|
+
requirement=True,
|
|
429
|
+
icon="VIEW_PAN",
|
|
430
|
+
)
|
|
431
|
+
LEFT_LOWER_ARM = _create_and_append_human_bone_specification(
|
|
432
|
+
all_human_bones,
|
|
433
|
+
HumanBoneName.LEFT_LOWER_ARM,
|
|
434
|
+
requirement=True,
|
|
435
|
+
icon="VIEW_PAN",
|
|
436
|
+
)
|
|
437
|
+
LEFT_HAND = _create_and_append_human_bone_specification(
|
|
438
|
+
all_human_bones,
|
|
439
|
+
HumanBoneName.LEFT_HAND,
|
|
440
|
+
requirement=True,
|
|
441
|
+
icon="VIEW_PAN",
|
|
442
|
+
)
|
|
443
|
+
RIGHT_SHOULDER = _create_and_append_human_bone_specification(
|
|
444
|
+
all_human_bones,
|
|
445
|
+
HumanBoneName.RIGHT_SHOULDER,
|
|
446
|
+
requirement=False,
|
|
447
|
+
icon="VIEW_PAN",
|
|
448
|
+
)
|
|
449
|
+
RIGHT_UPPER_ARM = _create_and_append_human_bone_specification(
|
|
450
|
+
all_human_bones,
|
|
451
|
+
HumanBoneName.RIGHT_UPPER_ARM,
|
|
452
|
+
requirement=True,
|
|
453
|
+
icon="VIEW_PAN",
|
|
454
|
+
)
|
|
455
|
+
RIGHT_LOWER_ARM = _create_and_append_human_bone_specification(
|
|
456
|
+
all_human_bones,
|
|
457
|
+
HumanBoneName.RIGHT_LOWER_ARM,
|
|
458
|
+
requirement=True,
|
|
459
|
+
icon="VIEW_PAN",
|
|
460
|
+
)
|
|
461
|
+
RIGHT_HAND = _create_and_append_human_bone_specification(
|
|
462
|
+
all_human_bones,
|
|
463
|
+
HumanBoneName.RIGHT_HAND,
|
|
464
|
+
requirement=True,
|
|
465
|
+
icon="VIEW_PAN",
|
|
466
|
+
)
|
|
467
|
+
|
|
468
|
+
# Finger
|
|
469
|
+
LEFT_THUMB_PROXIMAL = _create_and_append_human_bone_specification(
|
|
470
|
+
all_human_bones,
|
|
471
|
+
HumanBoneName.LEFT_THUMB_PROXIMAL,
|
|
472
|
+
requirement=False,
|
|
473
|
+
icon="VIEW_PAN",
|
|
474
|
+
)
|
|
475
|
+
LEFT_THUMB_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
476
|
+
all_human_bones,
|
|
477
|
+
HumanBoneName.LEFT_THUMB_INTERMEDIATE,
|
|
478
|
+
requirement=False,
|
|
479
|
+
icon="VIEW_PAN",
|
|
480
|
+
)
|
|
481
|
+
LEFT_THUMB_DISTAL = _create_and_append_human_bone_specification(
|
|
482
|
+
all_human_bones,
|
|
483
|
+
HumanBoneName.LEFT_THUMB_DISTAL,
|
|
484
|
+
requirement=False,
|
|
485
|
+
icon="VIEW_PAN",
|
|
486
|
+
)
|
|
487
|
+
LEFT_INDEX_PROXIMAL = _create_and_append_human_bone_specification(
|
|
488
|
+
all_human_bones,
|
|
489
|
+
HumanBoneName.LEFT_INDEX_PROXIMAL,
|
|
490
|
+
requirement=False,
|
|
491
|
+
icon="VIEW_PAN",
|
|
492
|
+
)
|
|
493
|
+
LEFT_INDEX_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
494
|
+
all_human_bones,
|
|
495
|
+
HumanBoneName.LEFT_INDEX_INTERMEDIATE,
|
|
496
|
+
requirement=False,
|
|
497
|
+
icon="VIEW_PAN",
|
|
498
|
+
)
|
|
499
|
+
LEFT_INDEX_DISTAL = _create_and_append_human_bone_specification(
|
|
500
|
+
all_human_bones,
|
|
501
|
+
HumanBoneName.LEFT_INDEX_DISTAL,
|
|
502
|
+
requirement=False,
|
|
503
|
+
icon="VIEW_PAN",
|
|
504
|
+
)
|
|
505
|
+
LEFT_MIDDLE_PROXIMAL = _create_and_append_human_bone_specification(
|
|
506
|
+
all_human_bones,
|
|
507
|
+
HumanBoneName.LEFT_MIDDLE_PROXIMAL,
|
|
508
|
+
requirement=False,
|
|
509
|
+
icon="VIEW_PAN",
|
|
510
|
+
)
|
|
511
|
+
LEFT_MIDDLE_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
512
|
+
all_human_bones,
|
|
513
|
+
HumanBoneName.LEFT_MIDDLE_INTERMEDIATE,
|
|
514
|
+
requirement=False,
|
|
515
|
+
icon="VIEW_PAN",
|
|
516
|
+
)
|
|
517
|
+
LEFT_MIDDLE_DISTAL = _create_and_append_human_bone_specification(
|
|
518
|
+
all_human_bones,
|
|
519
|
+
HumanBoneName.LEFT_MIDDLE_DISTAL,
|
|
520
|
+
requirement=False,
|
|
521
|
+
icon="VIEW_PAN",
|
|
522
|
+
)
|
|
523
|
+
LEFT_RING_PROXIMAL = _create_and_append_human_bone_specification(
|
|
524
|
+
all_human_bones,
|
|
525
|
+
HumanBoneName.LEFT_RING_PROXIMAL,
|
|
526
|
+
requirement=False,
|
|
527
|
+
icon="VIEW_PAN",
|
|
528
|
+
)
|
|
529
|
+
LEFT_RING_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
530
|
+
all_human_bones,
|
|
531
|
+
HumanBoneName.LEFT_RING_INTERMEDIATE,
|
|
532
|
+
requirement=False,
|
|
533
|
+
icon="VIEW_PAN",
|
|
534
|
+
)
|
|
535
|
+
LEFT_RING_DISTAL = _create_and_append_human_bone_specification(
|
|
536
|
+
all_human_bones,
|
|
537
|
+
HumanBoneName.LEFT_RING_DISTAL,
|
|
538
|
+
requirement=False,
|
|
539
|
+
icon="VIEW_PAN",
|
|
540
|
+
)
|
|
541
|
+
LEFT_LITTLE_PROXIMAL = _create_and_append_human_bone_specification(
|
|
542
|
+
all_human_bones,
|
|
543
|
+
HumanBoneName.LEFT_LITTLE_PROXIMAL,
|
|
544
|
+
requirement=False,
|
|
545
|
+
icon="VIEW_PAN",
|
|
546
|
+
)
|
|
547
|
+
LEFT_LITTLE_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
548
|
+
all_human_bones,
|
|
549
|
+
HumanBoneName.LEFT_LITTLE_INTERMEDIATE,
|
|
550
|
+
requirement=False,
|
|
551
|
+
icon="VIEW_PAN",
|
|
552
|
+
)
|
|
553
|
+
LEFT_LITTLE_DISTAL = _create_and_append_human_bone_specification(
|
|
554
|
+
all_human_bones,
|
|
555
|
+
HumanBoneName.LEFT_LITTLE_DISTAL,
|
|
556
|
+
requirement=False,
|
|
557
|
+
icon="VIEW_PAN",
|
|
558
|
+
)
|
|
559
|
+
RIGHT_THUMB_PROXIMAL = _create_and_append_human_bone_specification(
|
|
560
|
+
all_human_bones,
|
|
561
|
+
HumanBoneName.RIGHT_THUMB_PROXIMAL,
|
|
562
|
+
requirement=False,
|
|
563
|
+
icon="VIEW_PAN",
|
|
564
|
+
)
|
|
565
|
+
RIGHT_THUMB_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
566
|
+
all_human_bones,
|
|
567
|
+
HumanBoneName.RIGHT_THUMB_INTERMEDIATE,
|
|
568
|
+
requirement=False,
|
|
569
|
+
icon="VIEW_PAN",
|
|
570
|
+
)
|
|
571
|
+
RIGHT_THUMB_DISTAL = _create_and_append_human_bone_specification(
|
|
572
|
+
all_human_bones,
|
|
573
|
+
HumanBoneName.RIGHT_THUMB_DISTAL,
|
|
574
|
+
requirement=False,
|
|
575
|
+
icon="VIEW_PAN",
|
|
576
|
+
)
|
|
577
|
+
RIGHT_INDEX_PROXIMAL = _create_and_append_human_bone_specification(
|
|
578
|
+
all_human_bones,
|
|
579
|
+
HumanBoneName.RIGHT_INDEX_PROXIMAL,
|
|
580
|
+
requirement=False,
|
|
581
|
+
icon="VIEW_PAN",
|
|
582
|
+
)
|
|
583
|
+
RIGHT_INDEX_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
584
|
+
all_human_bones,
|
|
585
|
+
HumanBoneName.RIGHT_INDEX_INTERMEDIATE,
|
|
586
|
+
requirement=False,
|
|
587
|
+
icon="VIEW_PAN",
|
|
588
|
+
)
|
|
589
|
+
RIGHT_INDEX_DISTAL = _create_and_append_human_bone_specification(
|
|
590
|
+
all_human_bones,
|
|
591
|
+
HumanBoneName.RIGHT_INDEX_DISTAL,
|
|
592
|
+
requirement=False,
|
|
593
|
+
icon="VIEW_PAN",
|
|
594
|
+
)
|
|
595
|
+
RIGHT_MIDDLE_PROXIMAL = _create_and_append_human_bone_specification(
|
|
596
|
+
all_human_bones,
|
|
597
|
+
HumanBoneName.RIGHT_MIDDLE_PROXIMAL,
|
|
598
|
+
requirement=False,
|
|
599
|
+
icon="VIEW_PAN",
|
|
600
|
+
)
|
|
601
|
+
RIGHT_MIDDLE_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
602
|
+
all_human_bones,
|
|
603
|
+
HumanBoneName.RIGHT_MIDDLE_INTERMEDIATE,
|
|
604
|
+
requirement=False,
|
|
605
|
+
icon="VIEW_PAN",
|
|
606
|
+
)
|
|
607
|
+
RIGHT_MIDDLE_DISTAL = _create_and_append_human_bone_specification(
|
|
608
|
+
all_human_bones,
|
|
609
|
+
HumanBoneName.RIGHT_MIDDLE_DISTAL,
|
|
610
|
+
requirement=False,
|
|
611
|
+
icon="VIEW_PAN",
|
|
612
|
+
)
|
|
613
|
+
RIGHT_RING_PROXIMAL = _create_and_append_human_bone_specification(
|
|
614
|
+
all_human_bones,
|
|
615
|
+
HumanBoneName.RIGHT_RING_PROXIMAL,
|
|
616
|
+
requirement=False,
|
|
617
|
+
icon="VIEW_PAN",
|
|
618
|
+
)
|
|
619
|
+
RIGHT_RING_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
620
|
+
all_human_bones,
|
|
621
|
+
HumanBoneName.RIGHT_RING_INTERMEDIATE,
|
|
622
|
+
requirement=False,
|
|
623
|
+
icon="VIEW_PAN",
|
|
624
|
+
)
|
|
625
|
+
RIGHT_RING_DISTAL = _create_and_append_human_bone_specification(
|
|
626
|
+
all_human_bones,
|
|
627
|
+
HumanBoneName.RIGHT_RING_DISTAL,
|
|
628
|
+
requirement=False,
|
|
629
|
+
icon="VIEW_PAN",
|
|
630
|
+
)
|
|
631
|
+
RIGHT_LITTLE_PROXIMAL = _create_and_append_human_bone_specification(
|
|
632
|
+
all_human_bones,
|
|
633
|
+
HumanBoneName.RIGHT_LITTLE_PROXIMAL,
|
|
634
|
+
requirement=False,
|
|
635
|
+
icon="VIEW_PAN",
|
|
636
|
+
)
|
|
637
|
+
RIGHT_LITTLE_INTERMEDIATE = _create_and_append_human_bone_specification(
|
|
638
|
+
all_human_bones,
|
|
639
|
+
HumanBoneName.RIGHT_LITTLE_INTERMEDIATE,
|
|
640
|
+
requirement=False,
|
|
641
|
+
icon="VIEW_PAN",
|
|
642
|
+
)
|
|
643
|
+
RIGHT_LITTLE_DISTAL = _create_and_append_human_bone_specification(
|
|
644
|
+
all_human_bones,
|
|
645
|
+
HumanBoneName.RIGHT_LITTLE_DISTAL,
|
|
646
|
+
requirement=False,
|
|
647
|
+
icon="VIEW_PAN",
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
human_bone_name_to_human_bone: Mapping[HumanBoneName, HumanBoneSpecification] = {
|
|
651
|
+
human_bone.name: human_bone for human_bone in all_human_bones
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
all_names = tuple(b.name.value for b in all_human_bones)
|
|
655
|
+
|
|
656
|
+
required_names = tuple(b.name.value for b in all_human_bones if b.requirement)
|
|
657
|
+
|
|
658
|
+
optional_names = tuple(b.name.value for b in all_human_bones if not b.requirement)
|
|
659
|
+
|
|
660
|
+
@staticmethod
|
|
661
|
+
def get(name: HumanBoneName) -> HumanBoneSpecification:
|
|
662
|
+
return HumanBoneSpecifications.human_bone_name_to_human_bone[name]
|