Fixed ProcessNode to either Build armature or feed children for processing, not both

This commit is contained in:
Xiao Qi 2023-01-08 12:30:51 +08:00
parent 71dbf6632e
commit 3482688718
1 changed files with 6 additions and 4 deletions

View File

@ -47,16 +47,18 @@ namespace SH_COMP
GetMesh(*mesh, meshes.back()); GetMesh(*mesh, meshes.back());
meshes.back().name = node->mName.C_Str(); meshes.back().name = node->mName.C_Str();
} }
else else if (node->mParent != nullptr)
{ {
BuildArmature(node, rig); BuildArmature(node, rig);
} }
else
{
for (auto i{ 0 }; i < node->mNumChildren; ++i) for (auto i{ 0 }; i < node->mNumChildren; ++i)
{ {
ProcessNode(node->mChildren[i], scene, meshes, rig); ProcessNode(node->mChildren[i], scene, meshes, rig);
} }
} }
}
void MeshCompiler::GetMesh(aiMesh const& mesh, MeshData& meshData) noexcept void MeshCompiler::GetMesh(aiMesh const& mesh, MeshData& meshData) noexcept
{ {