Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

[ English / [日本語](#ja_JP) ]

# 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)
# KHR Character / 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)

VRM Add-on for Blender is an add-on that adds VRM-related functionality to
Blender.
Import, export, and editing functions for VRM format and experimental KHR
Character format.

## Download

Expand Down Expand Up @@ -103,9 +103,9 @@ New-Item -ItemType Junction -Path "$Env:APPDATA\Blender Foundation\Blender\$blen

[ [English](#en) / 日本語 ]

# 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)
# KHR Character / 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)

BlenderにVRM関連機能を追加するアドオンです
BlenderにVRM関連機能と実験的なKHR Character関連機能を追加するアドオンです

## ダウンロード

Expand Down
4 changes: 2 additions & 2 deletions src/io_scene_vrm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from .importer import gltf2_import_user_extension

bl_info = {
"name": "VRM format",
"name": "KHR Character / VRM format",
"author": "saturday06, iCyP",
"version": (
3, # x-release-please-major
19, # x-release-please-minor
0, # x-release-please-patch
),
"location": "File > Import-Export",
"description": "Import-Edit-Export VRM",
"description": "Import, export, and editing functions for VRM format.",
"blender": (2, 93, 0),
"warning": "",
"support": "COMMUNITY",
Expand Down
6 changes: 3 additions & 3 deletions src/io_scene_vrm/blender_manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ schema_version = "1.0.0"
id = "vrm"
version = "3.19.0"

name = "VRM format"
tagline = "VRM import, export and editing capabilities"
name = "KHR Character / VRM format"
tagline = "Import, export, and editing functions for VRM format and experimental KHR Character format."
maintainer = "Isamu Mogi <dyob@lunaport.net>"
type = "add-on"

Expand All @@ -23,4 +23,4 @@ copyright = [
]

[permissions]
files = "Import/export VRM from/to disk"
files = "Import/export KHR Character/VRM from/to disk"
186 changes: 186 additions & 0 deletions src/io_scene_vrm/common/ops/vrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,192 @@
import bpy


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def add_khr_xmp_json_ld_packet_dc_creator(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
) -> set[str]:
return bpy.ops.vrm.add_khr_xmp_json_ld_packet_dc_creator( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def remove_khr_xmp_json_ld_packet_dc_creator(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_creator_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.remove_khr_xmp_json_ld_packet_dc_creator( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_creator_index=dc_creator_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_up_khr_xmp_json_ld_packet_dc_creator(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_creator_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_up_khr_xmp_json_ld_packet_dc_creator( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_creator_index=dc_creator_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_down_khr_xmp_json_ld_packet_dc_creator(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_creator_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_down_khr_xmp_json_ld_packet_dc_creator( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_creator_index=dc_creator_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def add_khr_xmp_json_ld_packet_dc_license(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
) -> set[str]:
return bpy.ops.vrm.add_khr_xmp_json_ld_packet_dc_license( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def remove_khr_xmp_json_ld_packet_dc_license(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_license_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.remove_khr_xmp_json_ld_packet_dc_license( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_license_index=dc_license_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_up_khr_xmp_json_ld_packet_dc_license(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_license_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_up_khr_xmp_json_ld_packet_dc_license( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_license_index=dc_license_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_down_khr_xmp_json_ld_packet_dc_license(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_license_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_down_khr_xmp_json_ld_packet_dc_license( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_license_index=dc_license_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def add_khr_xmp_json_ld_packet_dc_subject(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
) -> set[str]:
return bpy.ops.vrm.add_khr_xmp_json_ld_packet_dc_subject( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def remove_khr_xmp_json_ld_packet_dc_subject(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_subject_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.remove_khr_xmp_json_ld_packet_dc_subject( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_subject_index=dc_subject_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_up_khr_xmp_json_ld_packet_dc_subject(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_subject_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_up_khr_xmp_json_ld_packet_dc_subject( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_subject_index=dc_subject_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def move_down_khr_xmp_json_ld_packet_dc_subject(
execution_context: str = "EXEC_DEFAULT",
/,
*,
armature_object_name: str = "",
dc_subject_index: int = 0,
) -> set[str]:
return bpy.ops.vrm.move_down_khr_xmp_json_ld_packet_dc_subject( # type: ignore[attr-defined, no-any-return]
execution_context,
armature_object_name=armature_object_name,
dc_subject_index=dc_subject_index,
)


# This code is auto generated.
# To regenerate, run the `uv run tools/property_typing.py` command.
def add_vrm0_first_person_mesh_annotation(
Expand Down
24 changes: 24 additions & 0 deletions src/io_scene_vrm/editor/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from collections.abc import Sequence
from typing import TYPE_CHECKING, Optional, TypeVar

import bpy
from bpy.props import (
CollectionProperty,
EnumProperty,
Expand All @@ -24,6 +25,7 @@

from ..common.logger import get_logger
from ..common.preferences import VrmAddonPreferences
from .khr_character.property_group import KhrCharacterPropertyGroup
from .mtoon1.property_group import Mtoon1MaterialPropertyGroup
from .node_constraint1.property_group import NodeConstraint1NodeConstraintPropertyGroup
from .property_group import StringPropertyGroup, property_group_enum
Expand Down Expand Up @@ -351,11 +353,29 @@ class VrmAddonArmatureExtensionPropertyGroup(PropertyGroup):
type=NodeConstraint1NodeConstraintPropertyGroup
)

khr_character: PointerProperty( # type: ignore[valid-type]
type=KhrCharacterPropertyGroup
)

SPEC_VERSION_VRM0 = "0.0"
SPEC_VERSION_VRM1 = "1.0"
SPEC_VERSION_KHR_CHARACTER = "KHR_character"
spec_version_items = (
(SPEC_VERSION_VRM0, "VRM 0.0", "", "NONE", 0),
(SPEC_VERSION_VRM1, "VRM 1.0", "", "NONE", 1),
*(
[
(
SPEC_VERSION_KHR_CHARACTER,
"KHR Character (Experimental)",
"",
"EXPERIMENTAL",
2,
)
]
if bpy.app.version >= (4, 5)
else []
),
)

def update_spec_version(self, context: Context) -> None:
Expand Down Expand Up @@ -403,6 +423,9 @@ def is_vrm0(self) -> bool:
def is_vrm1(self) -> bool:
return str(self.spec_version) == self.SPEC_VERSION_VRM1

def is_khr_character(self) -> bool:
return str(self.spec_version) == self.SPEC_VERSION_KHR_CHARACTER

@staticmethod
def has_vrm_model_metadata(obj: Object) -> bool:
if obj.type != "ARMATURE":
Expand Down Expand Up @@ -434,6 +457,7 @@ def has_vrm_model_metadata(obj: Object) -> bool:
node_constraint1: ( # type: ignore[no-redef]
NodeConstraint1NodeConstraintPropertyGroup
)
khr_character: KhrCharacterPropertyGroup # type: ignore[no-redef]
spec_version: str # type: ignore[no-redef]


Expand Down
1 change: 1 addition & 0 deletions src/io_scene_vrm/editor/khr_character/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later
42 changes: 42 additions & 0 deletions src/io_scene_vrm/editor/khr_character/panel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SPDX-License-Identifier: MIT OR GPL-3.0-or-later


from collections.abc import Set as AbstractSet

from bpy.types import Armature, Context, Panel

from ..extension import get_armature_extension
from ..khr_xmp_json_ld.panel import draw_khr_xmp_json_ld_packet_layout
from ..panel import VRM_PT_vrm_armature_object_property
from ..search import active_object_is_armature


class VRM_PT_vrm0_humanoid_armature_object_property(Panel):
bl_idname = "VRM_PT_vrm0_humanoid_armature_object_property"
bl_label = "VRM 0.x Humanoid"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "object"
bl_options: AbstractSet[str] = {"DEFAULT_CLOSED"}
bl_parent_id = VRM_PT_vrm_armature_object_property.bl_idname

@classmethod
def poll(cls, context: Context) -> bool:
return active_object_is_armature(context)

def draw_header(self, _context: Context) -> None:
self.layout.label(icon="ARMATURE_DATA")

def draw(self, context: Context) -> None:
active_object = context.active_object
if not active_object:
return
armature_data = active_object.data
if not isinstance(armature_data, Armature):
return
draw_khr_xmp_json_ld_packet_layout(
active_object,
context,
self.layout,
get_armature_extension(armature_data).khr_character.khr_xmp_json_ld_packet,
)
Loading