From 2a4c0dcb437e542e9440993fdbb6167b6b3e77a9 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 11 May 2025 20:55:52 +0100 Subject: [PATCH] fix: dumping xmodels with multiple surfaces and no bones --- src/ObjWriting/XModel/Gltf/GltfWriter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ObjWriting/XModel/Gltf/GltfWriter.cpp b/src/ObjWriting/XModel/Gltf/GltfWriter.cpp index 6ac7dea7..0a896c90 100644 --- a/src/ObjWriting/XModel/Gltf/GltfWriter.cpp +++ b/src/ObjWriting/XModel/Gltf/GltfWriter.cpp @@ -121,7 +121,8 @@ namespace for (auto meshIndex = 0u; meshIndex < meshCount; meshIndex++) rootNode.children->push_back(m_first_mesh_node + meshIndex); - rootNode.children->push_back(m_first_bone_node); + if (!xmodel.m_bones.empty()) + rootNode.children->push_back(m_first_bone_node); m_root_node = static_cast(gltf.nodes->size()); gltf.nodes->emplace_back(std::move(rootNode));