Files
blender-vrm/common/mtoon_unversioned.py
小煜 091ad6a49a feat: Add VRM Blender addon with complete import/export functionality
- Add core VRM addon infrastructure with manifest and registration
- Add common utilities module with file system, logging, and conversion helpers
- Add human bone mapper with support for multiple rigging standards (Mixamo, MMD, Unreal, Rigify, etc.)
- Add VRM 0.x and 1.x format support with property groups and handlers
- Add editor UI panels for VRM metadata, spring bones, and MToon materials
- Add exporter with glTF2 extension support for VRM format serialization
- Add importer with scene reconstruction and armature generation
- Add MToon shader support with auto-setup and material migration
- Add spring bone physics simulation with constraint handling
- Add node constraint editor for advanced rigging control
- Add comprehensive validation and error handling with user dialogs
- Add scene watcher for real-time property synchronization
- Add workspace management and preference system
- Include Python cache files and Blender manifest configuration
- This is the initial commit establishing the complete VRM addon ecosystem for Blender
2026-01-01 14:21:56 +08:00

63 lines
2.5 KiB
Python

# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
from collections.abc import Mapping
from typing import ClassVar, Optional
class MtoonUnversioned:
# {key = MToonProp, val = ShaderNodeGroup_member_name}
version = 32
float_props_exchange_dict: Mapping[str, Optional[str]] = {
"_MToonVersion": None,
"_Cutoff": "CutoffRate",
"_BumpScale": "BumpScale",
"_ReceiveShadowRate": "ReceiveShadowRate",
"_ShadeShift": "ShadeShift",
"_ShadeToony": "ShadeToony",
"_RimLightingMix": "RimLightingMix",
"_RimFresnelPower": "RimFresnelPower",
"_RimLift": "RimLift",
"_ShadingGradeRate": "ShadingGradeRate",
"_LightColorAttenuation": "LightColorAttenuation",
"_IndirectLightIntensity": "IndirectLightIntensity",
"_OutlineWidth": "OutlineWidth",
"_OutlineScaledMaxDistance": "OutlineScaleMaxDistance",
"_OutlineLightingMix": "OutlineLightingMix",
"_UvAnimScrollX": "UV_Scroll_X", # TODO: #####
"_UvAnimScrollY": "UV_Scroll_Y", # TODO: #####
"_UvAnimRotation": "UV_Scroll_Rotation", # TODO: #####
"_DebugMode": None,
"_BlendMode": None,
"_OutlineWidthMode": "OutlineWidthMode",
"_OutlineColorMode": "OutlineColorMode",
"_CullMode": None,
"_OutlineCullMode": None,
"_SrcBlend": None,
"_DstBlend": None,
"_ZWrite": None,
"_IsFirstSetup": None,
}
texture_kind_exchange_dict: Mapping[str, str] = {
"_MainTex": "MainTexture",
"_ShadeTexture": "ShadeTexture",
"_BumpMap": "NormalmapTexture",
"_ReceiveShadowTexture": "ReceiveShadow_Texture",
"_ShadingGradeTexture": "ShadingGradeTexture",
"_EmissionMap": "Emission_Texture",
"_SphereAdd": "SphereAddTexture",
"_RimTexture": "RimTexture",
"_OutlineWidthTexture": "OutlineWidthTexture",
"_UvAnimMaskTexture": "UV_Animation_Mask_Texture", # TODO: ####
}
vector_base_props_exchange_dict: Mapping[str, str] = {
"_Color": "DiffuseColor",
"_ShadeColor": "ShadeColor",
"_EmissionColor": "EmissionColor",
"_RimColor": "RimColor",
"_OutlineColor": "OutlineColor",
}
# texture offset and scaling props by texture
vector_props_exchange_dict: ClassVar[dict[str, str]] = {}
vector_props_exchange_dict.update(vector_base_props_exchange_dict)
vector_props_exchange_dict.update(texture_kind_exchange_dict)