From 528a0a551b9344e25a34f6718662f341fec6f6df Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sun, 25 May 2025 12:30:42 -0700 Subject: [PATCH] GLTF: Don't export AnimationPlayer nodes as glTF nodes --- modules/gltf/gltf_document.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 8b3bf8f6af..6e6cd8ca81 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5962,6 +5962,9 @@ void GLTFDocument::_convert_scene_node(Ref p_state, Node *p_current, } else if (Object::cast_to(p_current)) { AnimationPlayer *animation_player = Object::cast_to(p_current); p_state->animation_players.push_back(animation_player); + if (animation_player->get_child_count() == 0) { + gltf_node->set_parent(-2); // Don't export AnimationPlayer nodes as glTF nodes (unless they have children). + } } for (Ref ext : document_extensions) { ERR_CONTINUE(ext.is_null());