Skip to content

Commit d9b07c2

Browse files
committed
5.2.1 - Preserve Basis and pupil shape keys for eye meshes
Updated logic in model.py to always preserve the 'Basis' shape key and only keep pupil shape keys for left and right eye meshes. This prevents accidental removal of essential shape keys, ensuring proper eye mesh behavior.
1 parent 1de7c24 commit d9b07c2

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
*.pyc
55
*.txt
66
hoyo2vrc_updater/Hoyo2VRC_updater_status.json
7+
/dist
8+
deploy.py

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
bl_info = {
22
"name": "Hoyo2VRC",
33
"author": "Meliodas",
4-
"version": (5, 2, 0),
4+
"version": (5, 2, 1),
55
"blender": (4, 0, 0),
66
"location": "View3D > UI > Hoyo2VRC",
77
"description": "Convert Hoyoverse models to VRChat",

functions/model.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,11 +1149,16 @@ def separate_wuwa_eyes(context: bpy.types.Context,
11491149
if sk_name in left_eye.data.shape_keys.key_blocks:
11501150
left_eye.data.shape_keys.key_blocks[sk_name].value = value
11511151

1152-
# Keep only pupil shape keys
1152+
# Keep Basis (essential for proper eye mesh) and pupil shape keys only
11531153
shape_keys_to_remove = []
11541154
for shape_key in left_eye.data.shape_keys.key_blocks:
1155-
if shape_key.name == 'Basis' or shape_key.name in unused_shape_keys:
1155+
# Always preserve Basis - without it, pupil shapes become default
1156+
if shape_key.name == 'Basis':
11561157
continue
1158+
# Keep pupil shape keys on eye meshes
1159+
if unused_shape_keys and shape_key.name in unused_shape_keys:
1160+
continue
1161+
# Remove all other shape keys (facial expressions, etc.)
11571162
shape_keys_to_remove.append(shape_key.name)
11581163

11591164
if shape_keys_to_remove:
@@ -1195,11 +1200,16 @@ def separate_wuwa_eyes(context: bpy.types.Context,
11951200
if sk_name in right_eye.data.shape_keys.key_blocks:
11961201
right_eye.data.shape_keys.key_blocks[sk_name].value = value
11971202

1198-
# Keep only pupil shape keys
1203+
# Keep Basis (essential for proper eye mesh) and pupil shape keys only
11991204
shape_keys_to_remove = []
12001205
for shape_key in right_eye.data.shape_keys.key_blocks:
1201-
if shape_key.name == 'Basis' or shape_key.name in unused_shape_keys:
1206+
# Always preserve Basis - without it, pupil shapes become default
1207+
if shape_key.name == 'Basis':
1208+
continue
1209+
# Keep pupil shape keys on eye meshes
1210+
if unused_shape_keys and shape_key.name in unused_shape_keys:
12021211
continue
1212+
# Remove all other shape keys (facial expressions, etc.)
12031213
shape_keys_to_remove.append(shape_key.name)
12041214

12051215
if shape_keys_to_remove:

0 commit comments

Comments
 (0)