From 0b42d55f737369ff9cc80686bbc5b1cecd97d7b9 Mon Sep 17 00:00:00 2001 From: Heorhii Shakula Date: Wed, 24 Apr 2019 16:58:35 +0300 Subject: [PATCH] Fix inconsistency between animation and node name in glTF2 Importer --- code/glTF2Importer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 4228db23f..bb0f7ad8d 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -789,13 +789,16 @@ static void BuildVertexWeightMapping(Mesh::Primitive& primitive, std::vector& meshOffsets, glTF2::Ref& ptr) { Node& node = *ptr; - std::string nameOrId = node.name.empty() ? node.id : node.name; - - aiNode* ainode = new aiNode(nameOrId); + aiNode* ainode = new aiNode(GetNodeName(node)); if (!node.children.empty()) { ainode->mNumChildren = unsigned(node.children.size()); @@ -921,7 +924,7 @@ struct AnimationSamplers { aiNodeAnim* CreateNodeAnim(glTF2::Asset& r, Node& node, AnimationSamplers& samplers) { aiNodeAnim* anim = new aiNodeAnim(); - anim->mNodeName = node.name; + anim->mNodeName = GetNodeName(node); static const float kMillisecondsFromSeconds = 1000.f;