Merge pull request #436 from Laupetin/fix/gltf-without-bones

fix: dumping xmodels with multiple surfaces and no bones
This commit is contained in:
Jan 2025-05-11 22:20:46 +02:00 committed by GitHub
commit 450bd46902
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,7 +121,8 @@ namespace
for (auto meshIndex = 0u; meshIndex < meshCount; meshIndex++) for (auto meshIndex = 0u; meshIndex < meshCount; meshIndex++)
rootNode.children->push_back(m_first_mesh_node + 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<unsigned>(gltf.nodes->size()); m_root_node = static_cast<unsigned>(gltf.nodes->size());
gltf.nodes->emplace_back(std::move(rootNode)); gltf.nodes->emplace_back(std::move(rootNode));