Skip to content

Commit

Permalink
Backwards compatible assimp texture name fix
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
  • Loading branch information
luca-della-vedova committed Dec 14, 2023
1 parent 983a1eb commit 3ff0631
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion graphics/src/AssimpLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,12 @@ ImagePtr AssimpLoader::Implementation::LoadEmbeddedTexture(
std::string AssimpLoader::Implementation::GenerateTextureName(
const aiScene* _scene, aiMaterial* _mat, const std::string& _type) const
{
return ToString(_scene->mRootNode->mName) + "_" + ToString(_mat->GetName()) +
#ifdef GZ_ASSIMP_PRE_5_2_0
auto rootName = _scene->mRootNode->mName;
#else
auto rootName = _scene->mName;
#endif
return ToString(rootName) + "_" + ToString(_mat->GetName()) +
"_" + _type;
}

Expand Down

0 comments on commit 3ff0631

Please sign in to comment.