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:
@@ -40,8 +40,9 @@ static func load(glb_path: String) -> Node3D:
|
|||||||
print(" Animations: %d" % gltf.get_animation_count())
|
print(" Animations: %d" % gltf.get_animation_count())
|
||||||
print(" Meshes: %d" % gltf.get_mesh_count())
|
print(" Meshes: %d" % gltf.get_mesh_count())
|
||||||
|
|
||||||
# Generate scene
|
# Generate scene — remove_immutable_tracks=false preserves all bone
|
||||||
var scene = gltf.generate_scene(state)
|
# animation tracks (default true strips tracks where rest==pose → T-pose).
|
||||||
|
var scene = gltf.generate_scene(state, 30, false, false)
|
||||||
if not scene:
|
if not scene:
|
||||||
print("GLBLoader: failed to generate scene")
|
print("GLBLoader: failed to generate scene")
|
||||||
return null
|
return null
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ func load_model(path: String) -> void:
|
|||||||
return
|
return
|
||||||
|
|
||||||
print("SkinnedPlayerModel: parsed GLB, generating scene...")
|
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:
|
if not scene:
|
||||||
print("SkinnedPlayerModel: failed to generate scene")
|
print("SkinnedPlayerModel: failed to generate scene")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user