feat(miku): add rigged Miku character model with armature
- Generated rigged Miku model in Blender (79 mesh parts, 17 bones) - Bone names match Godot Humanoid skeleton (Hips, Spine, Chest, Head, etc.) - Includes idle animation (breath bounce) - Fixed GLB export for Blender 5.0 API compatibility - Updated HumanoidModel.apply_skin() with orientation fix - Player 1 spawns with Miku rigged model, others get default blue - Preview renders in docs/characters/skins/ Pipeline established: - Blender headless -> Python script -> GLB export -> Godot import - Skin system: PlayerSkin resource + SkinManager - apply_skin() handles both GLB model and procedural color tint
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -179,6 +179,10 @@ func apply_skin(skin: PlayerSkin) -> void:
|
|||||||
skin_model = loaded.instantiate()
|
skin_model = loaded.instantiate()
|
||||||
if skin_model:
|
if skin_model:
|
||||||
skin_model.name = "SkinModel"
|
skin_model.name = "SkinModel"
|
||||||
|
# Fix orientation: Blender Z-up to Godot Y-up
|
||||||
|
skin_model.rotation_degrees = Vector3(0, 0, 0)
|
||||||
|
# Scale down if needed (Blender models can be large)
|
||||||
|
skin_model.scale = Vector3(1, 1, 1)
|
||||||
add_child(skin_model)
|
add_child(skin_model)
|
||||||
print("HumanoidModel: applied skin '%s'" % skin.skin_name)
|
print("HumanoidModel: applied skin '%s'" % skin.skin_name)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -381,9 +381,15 @@ func _spawn_player(pid: int) -> CharacterBody3D:
|
|||||||
if pid == 1:
|
if pid == 1:
|
||||||
var miku_skin = PlayerSkin.new()
|
var miku_skin = PlayerSkin.new()
|
||||||
miku_skin.skin_name = "Miku"
|
miku_skin.skin_name = "Miku"
|
||||||
miku_skin.model_path = "res://assets/characters/skins/miku.glb"
|
miku_skin.model_path = "res://assets/characters/skins/miku_rigged.glb"
|
||||||
miku_skin.color_tint = Color(0.0, 0.75, 0.75)
|
miku_skin.color_tint = Color(0.0, 0.75, 0.75)
|
||||||
humanoid.apply_skin(miku_skin)
|
humanoid.apply_skin(miku_skin)
|
||||||
|
else:
|
||||||
|
# Default blue skin for other players
|
||||||
|
var default_skin = PlayerSkin.new()
|
||||||
|
default_skin.skin_name = "Default"
|
||||||
|
default_skin.color_tint = Color(0.2, 0.4, 0.8)
|
||||||
|
humanoid.apply_skin(default_skin)
|
||||||
|
|
||||||
# Movement State Machine
|
# Movement State Machine
|
||||||
var sm := Node.new()
|
var sm := Node.new()
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 155 KiB |
Reference in New Issue
Block a user