Skip to content

Commit 62c5335

Browse files
committed
Wuthering Waves Support
1 parent a966c96 commit 62c5335

File tree

6 files changed

+799
-26
lines changed

6 files changed

+799
-26
lines changed

Tools/armature_utils.py

Lines changed: 258 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,142 @@ def GetGameData(game):
490490
"finger": "Finger",
491491
"part": "Part",
492492
},
493+
},
494+
elif game == "Wuthering Waves":
495+
return {
496+
"bone_names": {
497+
"Pelvis": "Hips",
498+
"LThigh": "Left leg",
499+
"RThigh": "Right leg",
500+
"LCalf": "Left knee",
501+
"RCalf": "Right knee",
502+
"LFoot": "Left ankle",
503+
"RFoot": "Right ankle",
504+
"LToe0": "Left toe",
505+
"RToe0": "Right toe",
506+
"LClavicle": "Left shoulder",
507+
"RClavicle": "Right shoulder",
508+
"LUpperArm": "Left arm",
509+
"RUpperArm": "Right arm",
510+
"LForearm": "Left elbow",
511+
"RForearm": "Right elbow",
512+
"LHand": "Left wrist",
513+
"RHand": "Right wrist",
514+
"LFinger0": "Thumb1_L",
515+
"LFinger01": "Thumb2_L",
516+
"LFinger02": "Thumb3_L",
517+
"LFinger1": "IndexFinger1_L",
518+
"LFinger11": "IndexFinger2_L",
519+
"LFinger12": "IndexFinger3_L",
520+
"LFinger2": "MiddleFinger1_L",
521+
"LFinger21": "MiddleFinger2_L",
522+
"LFinger22": "MiddleFinger3_L",
523+
"LFinger3": "RingFinger1_L",
524+
"LFinger31": "RingFinger2_L",
525+
"LFinger32": "RingFinger3_L",
526+
"LFinger4": "LittleFinger1_L",
527+
"LFinger41": "LittleFinger2_L",
528+
"LFinger42": "LittleFinger3_L",
529+
"RFinger0": "Thumb1_R",
530+
"RFinger01": "Thumb2_R",
531+
"RFinger02": "Thumb3_R",
532+
"RFinger1": "IndexFinger1_R",
533+
"RFinger11": "IndexFinger2_R",
534+
"RFinger12": "IndexFinger3_R",
535+
"RFinger2": "MiddleFinger1_R",
536+
"RFinger21": "MiddleFinger2_R",
537+
"RFinger22": "MiddleFinger3_R",
538+
"RFinger3": "RingFinger1_R",
539+
"RFinger31": "RingFinger2_R",
540+
"RFinger32": "RingFinger3_R",
541+
"RFinger4": "LittleFinger1_R",
542+
"RFinger41": "LittleFinger2_R",
543+
"RFinger42": "LittleFinger3_R",
544+
"Root_M": "Hips",
545+
"Hip_L": "Left leg",
546+
"Hip_R": "Right leg",
547+
"HipPart1_R": "Right leg twist R",
548+
"HipPart1_L": "Left leg twist L",
549+
"Spine1_M": "Spine",
550+
"Spine2_M": "Chest",
551+
"Chest_M": "Upper Chest",
552+
"Shoulder_L": "Left arm",
553+
"Shoulder_R": "Right arm",
554+
"Scapula_R": "Right shoulder",
555+
"Scapula_L": "Left shoulder",
556+
"Neck_M": "Neck",
557+
"Head_M": "Head",
558+
"face": "Face",
559+
"Knee_L": "Left knee",
560+
"Knee_R": "Right knee",
561+
"Ankle_L": "Left ankle",
562+
"Ankle_R": "Right ankle",
563+
"Toes_L": "Left toe",
564+
"Toes_R": "Right toe",
565+
"Elbow_L": "Left elbow",
566+
"Elbow_R": "Right elbow",
567+
"Wrist_L": "Left wrist",
568+
"Wrist_R": "Right wrist",
569+
"LFinger5": "Thumb1_L",
570+
"LFinger51": "Thumb2_L",
571+
"LFinger52": "Thumb3_L",
572+
"RFinger5": "Thumb1_R",
573+
"RFinger51": "Thumb2_R",
574+
"RFinger52": "Thumb3_R",
575+
},
576+
"starts_with": {
577+
"_": "",
578+
"ValveBiped_": "",
579+
"Valvebiped_": "",
580+
"Bip1_": "Bip_",
581+
"Bip01_": "Bip_",
582+
"Bip01": "",
583+
"Bip001": "",
584+
"Bip02_": "Bip_",
585+
"Character1_": "",
586+
"HLP_": "",
587+
"JD_": "",
588+
"JU_": "",
589+
"Armature|": "",
590+
"Bone_": "",
591+
"C_": "",
592+
"Cf_S_": "",
593+
"Cf_J_": "",
594+
"G_": "",
595+
"Joint_": "",
596+
"Def_C_": "",
597+
"Def_": "",
598+
"DEF_": "",
599+
"Chr_": "",
600+
"B_": "",
601+
},
602+
"ends_with": {
603+
"_Bone": "",
604+
"_Bn": "",
605+
"_Le": "_L",
606+
"_Ri": "_R",
607+
"_": "",
608+
"_End": "",
609+
},
610+
"replaces": {
611+
" ": "_",
612+
"-": "_",
613+
".": "_",
614+
":": "_",
615+
"____": "_",
616+
"___": "_",
617+
"__": "_",
618+
"_Le_": "_L_",
619+
"_l": "_L",
620+
"_Ri_": "_R_",
621+
"_r": "_R",
622+
"_m": "_M",
623+
"LEFT": "Left",
624+
"RIGHT": "Right",
625+
"all": "All",
626+
"finger": "Finger",
627+
"part": "Part",
628+
},
493629
}
494630

495631

@@ -544,6 +680,107 @@ def CleanBones():
544680
"Bone_Eye_R_01",
545681
"Skin_GRP",
546682
"Main",
683+
"Root",
684+
"WeaponProp00",
685+
"WeaponProp01",
686+
"WeaponProp02",
687+
"WeaponProp03",
688+
"WeaponProp04",
689+
"WeaponProp05",
690+
"WeaponProp06",
691+
"WeaponProp07",
692+
"WeaponProp08",
693+
"WeaponProp09",
694+
"WeaponProp10",
695+
"Weapon000",
696+
"Weapon001",
697+
"Weapon002",
698+
"Weapon003",
699+
"Weapon004",
700+
"Weapon005",
701+
"Weapon006",
702+
"Weapon007",
703+
"Weapon008",
704+
"Weapon009",
705+
"Weapon010",
706+
"CameraPosition",
707+
"MiddleCase",
708+
"LeftSuspensionCase",
709+
"RightSuspensionCase",
710+
"DeviceLine",
711+
"Device_Light",
712+
"Bone",
713+
"Burst_Focus",
714+
"EyeEffectCase2",
715+
"EyeEffectCase1",
716+
"EyeEffectCase",
717+
"MarkCase",
718+
"HitCase",
719+
"_Shoulder_R_F",
720+
"_Shoulder_L_F",
721+
"_Shoulder_R_B",
722+
"_Shoulder_L_B",
723+
"_Shoulder_R_M",
724+
"_Shoulder_L_M",
725+
"_Shoulder_R_A",
726+
"_Shoulder_R_B",
727+
"_Shoulder_R_C",
728+
"_Shoulder_R_D",
729+
"_Shoulder_R_E",
730+
"_Shoulder_R_F",
731+
"_Shoulder_R_G",
732+
"_Shoulder_R_H",
733+
"_Shoulder_R_I",
734+
"_Shoulder_R_J",
735+
"_Shoulder_R_K",
736+
"_Shoulder_R_L",
737+
"_Shoulder_R_M",
738+
"_Shoulder_R_N",
739+
"_Shoulder_R_O",
740+
"_Shoulder_R_P",
741+
"_Shoulder_R_Q",
742+
"_Shoulder_R_R",
743+
"_Shoulder_R_S",
744+
"_Shoulder_R_T",
745+
"_Shoulder_R_U",
746+
"_Shoulder_R_V",
747+
"_Shoulder_R_W",
748+
"_Shoulder_R_X",
749+
"_Shoulder_R_Y",
750+
"_Shoulder_R_Z",
751+
"_Shoulder_L_A",
752+
"_Shoulder_L_B",
753+
"_Shoulder_L_C",
754+
"_Shoulder_L_D",
755+
"_Shoulder_L_E",
756+
"_Shoulder_L_F",
757+
"_Shoulder_L_G",
758+
"_Shoulder_L_H",
759+
"_Shoulder_L_I",
760+
"_Shoulder_L_J",
761+
"_Shoulder_L_K",
762+
"_Shoulder_L_L",
763+
"_Shoulder_L_M",
764+
"_Shoulder_L_N",
765+
"_Shoulder_L_O",
766+
"_Shoulder_L_P",
767+
"_Shoulder_L_Q",
768+
"_Shoulder_L_R",
769+
"_Shoulder_L_S",
770+
"_Shoulder_L_T",
771+
"_Shoulder_L_U",
772+
"_Shoulder_L_V",
773+
"_Shoulder_L_W",
774+
"_Shoulder_L_X",
775+
"_Shoulder_L_Y",
776+
"_Shoulder_L_Z",
777+
"_R_CalfTwist",
778+
"_L_CalfTwist",
779+
"HuluProp01",
780+
"HeadSocket",
781+
"BuffSocket",
782+
783+
547784
]
548785

549786
# Get the armature object
@@ -625,7 +862,7 @@ def FixHips(hips, right_leg, left_leg, spine, x_cord, y_cord, z_cord):
625862
# Make Hips point straight up
626863
hips.tail[x_cord] = hips.head[x_cord]
627864
hips.tail[y_cord] = hips.head[y_cord]
628-
hips.tail[z_cord] = spine.head[z_cord]
865+
hips.tail[z_cord] = spine.head[z_cord] + 4
629866

630867
if hips.tail[z_cord] < hips.head[z_cord]:
631868
hips.tail[z_cord] = hips.tail[z_cord] + 0.1
@@ -641,7 +878,17 @@ def FixSpine(spine, hips, x_cord, y_cord, z_cord):
641878
spine.tail[x_cord] = spine.head[x_cord]
642879
spine.tail[y_cord] = spine.head[y_cord] # Align tail with head on y-axis
643880
spine.tail[z_cord] = spine.head[z_cord] + 0.065
881+
882+
def FixWWSpine(spine, hips, x_cord, y_cord, z_cord):
883+
# Fixing Spine
884+
spine.head[x_cord] = hips.tail[x_cord]
885+
spine.head[y_cord] = hips.tail[y_cord]
886+
spine.head[z_cord] = hips.tail[z_cord]
644887

888+
# Make Spine point straight up
889+
spine.tail[x_cord] = spine.head[x_cord]
890+
spine.tail[y_cord] = spine.head[y_cord] # Align tail with head on y-axis
891+
spine.tail[z_cord] = spine.head[z_cord] + 8
645892

646893
def FixChest(chest, spine, x_cord, y_cord, z_cord):
647894
chest.head[x_cord] = spine.tail[x_cord]
@@ -651,6 +898,15 @@ def FixChest(chest, spine, x_cord, y_cord, z_cord):
651898
chest.tail[x_cord] = chest.head[x_cord]
652899
chest.tail[y_cord] = chest.head[y_cord]
653900
chest.tail[z_cord] = chest.head[z_cord] + 0.065
901+
902+
def FixWWChest(chest, spine, x_cord, y_cord, z_cord):
903+
chest.head[x_cord] = spine.tail[x_cord]
904+
chest.head[y_cord] = spine.tail[y_cord]
905+
chest.head[z_cord] = spine.tail[z_cord]
906+
907+
chest.tail[x_cord] = chest.head[x_cord]
908+
chest.tail[y_cord] = chest.head[y_cord]
909+
chest.tail[z_cord] = chest.head[z_cord] + 8
654910

655911

656912
def FixUpperChest(upperchest, chest, x_cord, y_cord, z_cord):
@@ -743,7 +999,7 @@ def attacheyes(armature, eye_bone_name, attach_to):
743999
eye_bone.tail.x = eye_bone.head.x
7441000
eye_bone.tail.y = eye_bone.head.y
7451001
eye_bone.tail.z = attach_to_bone.head.z + 0.12
746-
1002+
7471003

7481004
def MoveBone(armature, bone):
7491005
bone.select = True

Tools/blender_utils.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,40 @@ def SetActiveObject(obj_name):
3434
if obj is not None:
3535
bpy.context.view_layer.objects.active = obj
3636
return obj
37+
38+
def CursorToObject(object_name, x_offset=0, y_offset=0.035):
39+
# Select the specified object
40+
obj = bpy.data.objects.get(object_name)
41+
if obj is None:
42+
raise ValueError(f"Object '{object_name}' not found")
43+
44+
# Set the object as the active object and select it
45+
bpy.context.view_layer.objects.active = obj
46+
obj.select_set(True)
47+
48+
# Enter edit mode
49+
bpy.ops.object.mode_set(mode='EDIT')
50+
51+
# Select all vertices
52+
bpy.ops.mesh.select_all(action='SELECT')
53+
54+
# Snap the cursor to the selected vertices
55+
original_area_type = bpy.context.area.type
56+
bpy.context.area.type = 'VIEW_3D'
57+
bpy.ops.view3d.snap_cursor_to_selected()
58+
bpy.context.area.type = original_area_type
59+
60+
# Adjust the cursor location
61+
cursor_location = bpy.context.scene.cursor.location
62+
cursor_location.x += x_offset
63+
cursor_location.y += y_offset
64+
bpy.context.scene.cursor.location = cursor_location
65+
66+
# Deselect the object
67+
obj.select_set(False)
68+
69+
# Exit edit mode
70+
bpy.ops.object.mode_set(mode='OBJECT')
71+
72+
def ResetCursor():
73+
bpy.context.scene.cursor.location = (0.0, 0.0, 0.0)

0 commit comments

Comments
 (0)