fix: correct skin deformation and scale for GLB character models
The Miku model T-posed because the previous _update_skin() used set_bone_pose(i, get_bone_pose(i)) which is a no-op when the pose is unchanged. Replace with skeleton.notification(NOTIFICATION_UPDATE_SKELETON) to force the Skeleton3D to recompute bone transforms and notify the MeshInstance to update vertex buffers. Also fix scale: the GLB is ~1.2m tall (not 1.6m as documented), so set scale_factor=1.25 to fit the 1.8m player capsule, and add position_y_offset=-0.2 to align the model's feet with the player origin. Co-Authored-By: Hermes Agent <[email protected]>
This commit is contained in:
@@ -433,7 +433,8 @@ func _spawn_player(pid: int) -> CharacterBody3D:
|
||||
var skinned = load("res://characters/skinned_player_model.gd").new()
|
||||
skinned.name = "SkinnedModel"
|
||||
skinned.model_path = "res://assets/characters/skins/miku_rigged_animated.glb"
|
||||
skinned.scale_factor = 1.0 # Already scaled to 1.8m in Blender
|
||||
skinned.scale_factor = 1.25 # GLB is ~1.2m, scale to ~1.5m for player capsule
|
||||
skinned.position_y_offset = -0.2 # Align feet with player origin
|
||||
skinned.position = Vector3.ZERO # Model origin = player origin
|
||||
player.add_child(skinned)
|
||||
print("TestLevelBuilder: added SkinnedModel for player 1")
|
||||
|
||||
Reference in New Issue
Block a user