fix: use GLTFDocument to load GLB at runtime (no .import needed)

Godot headless/CLI can't import GLB files — the GLTF loader only works
in the editor GUI. Switched SkinnedPlayerModel to use GLTFDocument.append_from_buffer()
which parses GLB data from raw bytes at runtime.

Verified: GLB parses successfully, generates scene with MikuRig skeleton,
AnimationPlayer, and 7 animations (Crouch, Death, Idle, Idle_001, Jump, Run, Walk).

Also added characters/glb_loader.gd as a reusable utility for loading
any GLB file at runtime.
This commit is contained in:
2026-06-23 01:15:37 -04:00
parent 85066f71f3
commit 5e12502a18
7 changed files with 223 additions and 32 deletions
+3 -2
View File
@@ -148,9 +148,10 @@ 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.position = Vector3(0, 0.0, 0) # Model origin aligns with player origin
skinned.first_person_mode = true # Hide body in FPS view, show only arms
skinned.position = Vector3(0, 0.0, 0)
skinned.first_person_mode = true
player.add_child(skinned)
print("LevelRuntime: added SkinnedModel for local player")
else:
# Remote players: use procedural humanoid
var humanoid = load("res://characters/humanoid_model.gd").new()