From 9947ee7526aa01dfbe1c5ffba4584451ea378094 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Fri, 21 Nov 2025 12:42:45 +0100 Subject: [PATCH] Debug sampling of an animation works. Though extremely experimental/explorative. --- synced_animation_graph.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synced_animation_graph.cpp b/synced_animation_graph.cpp index 74ffc4d..3632554 100644 --- a/synced_animation_graph.cpp +++ b/synced_animation_graph.cpp @@ -156,6 +156,13 @@ void SyncedAnimationGraph::_process_graph(double p_delta, bool p_update_only) { return; } + static double debug_time = 0.; + debug_time += p_delta; + if (debug_time > 2.0) { + debug_time = 0.; + } + + current_time = debug_time; // LocalVector &track_num_to_track_cache = animation_track_num_to_track_cache[a]; const Vector tracks = animation->get_tracks(); @@ -185,6 +192,7 @@ void SyncedAnimationGraph::_process_graph(double p_delta, bool p_update_only) { Vector3 pos; animation->try_position_track_interpolate(i, animation_time, &pos); skeleton->set_bone_pose_position(bone_idx, pos); + print_line(vformat("t = %3.3f: setting bone %d pos to %2.3f, %2.3f, %2.3f", animation_time, bone_idx, pos.x, pos.y, pos.z)); } } break;