fix(characters): preserve all animation tracks in GLTF runtime loading

remove_immutable_tracks=true (default) strips bone tracks where keyframes
match rest pose, removing 80%+ of tracks and causing T-pose.
Editor import uses false; runtime must match.

Closes T-pose bug where animations reported playing but model stayed rigid.
This commit is contained in:
2026-06-25 10:04:56 -04:00
parent d297da4c35
commit d6da221583
2 changed files with 8 additions and 3 deletions
+3 -2
View File
@@ -40,8 +40,9 @@ static func load(glb_path: String) -> Node3D:
print(" Animations: %d" % gltf.get_animation_count())
print(" Meshes: %d" % gltf.get_mesh_count())
# Generate scene
var scene = gltf.generate_scene(state)
# Generate scene — remove_immutable_tracks=false preserves all bone
# animation tracks (default true strips tracks where rest==pose → T-pose).
var scene = gltf.generate_scene(state, 30, false, false)
if not scene:
print("GLBLoader: failed to generate scene")
return null
+5 -1
View File
@@ -52,7 +52,11 @@ func load_model(path: String) -> void:
return
print("SkinnedPlayerModel: parsed GLB, generating scene...")
var scene = gltf.generate_scene(state)
# remove_immutable_tracks=false is CRITICAL — when true (default), Godot
# strips animation tracks whose values equal the rest pose. This causes
# partial T-pose because some bones only move in certain animations.
# Editor import sets this to false; runtime loading does not.
var scene = gltf.generate_scene(state, 30, false, false)
if not scene:
print("SkinnedPlayerModel: failed to generate scene")
return