Use unique node names when loading Collada files

pull/1345/head
jamesgk 2017-07-14 11:42:55 -07:00
parent c9912fd481
commit 727cffdfb4
1 changed files with 5 additions and 6 deletions

View File

@ -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) 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 // Now setup the name of the assimp node. The collada name might not be
// FIX: Workaround for XSI calling the instanced visual scene 'untitled' by default. // unique, so we use the collada ID.
if (!pNode->mName.empty() && pNode->mName != "untitled") if (!pNode->mID.empty())
return pNode->mName;
else if (!pNode->mID.empty())
return pNode->mID; return pNode->mID;
else if (!pNode->mSID.empty()) else if (!pNode->mSID.empty())
return pNode->mSID; return pNode->mSID;