From 727cffdfb47c8372d51d321a242c94f6439d6588 Mon Sep 17 00:00:00 2001 From: jamesgk Date: Fri, 14 Jul 2017 11:42:55 -0700 Subject: [PATCH] Use unique node names when loading Collada files --- code/ColladaLoader.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index e82bf1560..c68eb27c9 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -1903,14 +1903,13 @@ const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, c } // ------------------------------------------------------------------------------------------------ -// Finds a proper name for a node derived from the collada-node's properties +// Finds a proper unique name for a node derived from the collada-node's properties. +// The name must be unique for proper node-bone association. std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode) { - // now setup the name of the node. We take the name if not empty, otherwise the collada ID - // FIX: Workaround for XSI calling the instanced visual scene 'untitled' by default. - if (!pNode->mName.empty() && pNode->mName != "untitled") - return pNode->mName; - else if (!pNode->mID.empty()) + // Now setup the name of the assimp node. The collada name might not be + // unique, so we use the collada ID. + if (!pNode->mID.empty()) return pNode->mID; else if (!pNode->mSID.empty()) return pNode->mSID;