debug: add logging to verify procedural animation execution
This commit is contained in:
@@ -443,7 +443,6 @@ func play_animation(anim_name: String) -> void:
|
|||||||
return
|
return
|
||||||
# Animation missing — already covered by _ensure_locomotion_animations()
|
# Animation missing — already covered by _ensure_locomotion_animations()
|
||||||
|
|
||||||
var _last_played: String = ""
|
|
||||||
var _missing_anim_warned: Array = []
|
var _missing_anim_warned: Array = []
|
||||||
|
|
||||||
func _warn_missing(anim_name: String) -> void:
|
func _warn_missing(anim_name: String) -> void:
|
||||||
@@ -501,9 +500,14 @@ func _process(delta: float) -> void:
|
|||||||
if target_anim != _current_anim_name:
|
if target_anim != _current_anim_name:
|
||||||
_current_anim_name = target_anim
|
_current_anim_name = target_anim
|
||||||
_anim_time = 0.0
|
_anim_time = 0.0
|
||||||
# Also play on AP for debug output
|
# Play on AP only for non-procedural anims (Death, Crouch)
|
||||||
|
# Procedural anims are applied directly to bones — AP must NOT
|
||||||
|
# play GLB anims or it will overwrite our manual bone poses
|
||||||
if animation_player and animation_player.has_animation(target_anim):
|
if animation_player and animation_player.has_animation(target_anim):
|
||||||
|
if not _procedural_anims.has(target_anim):
|
||||||
animation_player.play(target_anim)
|
animation_player.play(target_anim)
|
||||||
|
else:
|
||||||
|
animation_player.stop()
|
||||||
|
|
||||||
# Advance animation time
|
# Advance animation time
|
||||||
if _procedural_anims.has(_current_anim_name):
|
if _procedural_anims.has(_current_anim_name):
|
||||||
@@ -517,6 +521,11 @@ func _process(delta: float) -> void:
|
|||||||
_anim_time = min(_anim_time, length)
|
_anim_time = min(_anim_time, length)
|
||||||
# Apply procedural animation to skeleton
|
# Apply procedural animation to skeleton
|
||||||
_apply_procedural_animation(data, _anim_time)
|
_apply_procedural_animation(data, _anim_time)
|
||||||
|
# Debug: log once per second
|
||||||
|
_anim_debug_timer += delta
|
||||||
|
if _anim_debug_timer > 1.0:
|
||||||
|
_anim_debug_timer = 0.0
|
||||||
|
print("SkinnedPlayerModel: procedural '%s' t=%.2f" % [_current_anim_name, _anim_time])
|
||||||
elif animation_player:
|
elif animation_player:
|
||||||
# For non-procedural anims (Death, Crouch from GLB), just update skin
|
# For non-procedural anims (Death, Crouch from GLB), just update skin
|
||||||
call_deferred("_update_skin")
|
call_deferred("_update_skin")
|
||||||
|
|||||||
Reference in New Issue
Block a user