From 33ce7441f8d3806f21dc46dc6882184edb91a6d8 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Sat, 3 Jan 2026 15:50:50 -0800 Subject: [PATCH] GLTF: fix getting animation track path --- modules/gltf/gltf_document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 71d4163d21..cdddf0bae6 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -6379,7 +6379,9 @@ void GLTFDocument::_convert_animation(Ref p_state, AnimationPlayer *p } // Get the Godot node and the glTF node index for the animation track. const NodePath track_path = animation->track_get_path(track_index); - const Node *anim_player_parent = p_animation_player->get_parent(); + const NodePath root_node = p_animation_player->get_root_node(); + const Node *anim_player_parent = p_animation_player->get_node_or_null(root_node); + ERR_CONTINUE_MSG(!anim_player_parent, "glTF: Cannot get root node for animation player: " + String(root_node)); const Node *animated_node = anim_player_parent->get_node_or_null(track_path); ERR_CONTINUE_MSG(!animated_node, "glTF: Cannot get node for animated track using path: " + String(track_path)); const GLTFAnimation::Interpolation gltf_interpolation = GLTFAnimation::godot_to_gltf_interpolation(animation, track_index);