Merge pull request #2353 from phr34k/fix-bug-autogenerated-names
Fix automatic name assignment for ColladaLoader when using name based assignmentpull/2354/head^2
commit
b7906bcce9
|
@ -1926,10 +1926,16 @@ const Collada::Node* ColladaLoader::FindNodeBySID( const Collada::Node* pNode, c
|
||||||
std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode)
|
std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode)
|
||||||
{
|
{
|
||||||
// If explicitly requested, just use the collada name.
|
// If explicitly requested, just use the collada name.
|
||||||
if (useColladaName) {
|
if (useColladaName)
|
||||||
|
{
|
||||||
|
if (!pNode->mName.empty()) {
|
||||||
return pNode->mName;
|
return pNode->mName;
|
||||||
|
} else {
|
||||||
|
return format() << "$ColladaAutoName$_" << mNodeNameCounter++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Now setup the name of the assimp node. The collada name might not be
|
// Now setup the name of the assimp node. The collada name might not be
|
||||||
// unique, so we use the collada ID.
|
// unique, so we use the collada ID.
|
||||||
if (!pNode->mID.empty())
|
if (!pNode->mID.empty())
|
||||||
|
@ -1943,5 +1949,6 @@ std::string ColladaLoader::FindNameForNode( const Collada::Node* pNode)
|
||||||
return format() << "$ColladaAutoName$_" << mNodeNameCounter++;
|
return format() << "$ColladaAutoName$_" << mNodeNameCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_DAE_IMPORTER
|
||||||
|
|
Loading…
Reference in New Issue