Skip to content

Commit

Permalink
Merge branch 'gz-common5' into mjcarroll/asan
Browse files Browse the repository at this point in the history
  • Loading branch information
ahcorde authored Jan 16, 2024
2 parents 38f4d23 + c948a9d commit b991f71
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-common/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-common)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_common-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_common-ci-main-focal-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_common-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_common-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_common-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_common-ci-win/)
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-common/tree/gz-common5/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-common/tree/gz-common5)
Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_common-ci-gz-common5-jammy-amd64)](https://build.osrfoundation.org/job/gz_common-ci-gz-common5-jammy-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_common-ci-gz-common5-homebrew-amd64)](https://build.osrfoundation.org/job/gz_common-ci-gz-common5-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/gz_common-5-win/badge/icon)](https://build.osrfoundation.org/job/gz_common-5-win/)

Gazebo Common, a component of [Gazebo](https://gazebosim.org), provides a set of libraries that
cover many different use cases. An audio-visual library supports
Expand Down
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
6 changes: 6 additions & 0 deletions graphics/src/AssimpLoader_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,13 @@ TEST_F(AssimpLoader, LoadGlTF2BoxWithJPEGTexture)
EXPECT_EQ(math::Color(0.4f, 0.4f, 0.4f, 1.0f), mat->Ambient());
EXPECT_EQ(math::Color(1.0f, 1.0f, 1.0f, 1.0f), mat->Diffuse());
EXPECT_EQ(math::Color(0.0f, 0.0f, 0.0f, 1.0f), mat->Specular());
// Assimp 5.2.0 and above uses the scene name for its texture names,
// older version use the root node instead.
#ifdef GZ_ASSIMP_PRE_5_2_0
EXPECT_EQ("Cube_Material_Diffuse", mat->TextureImage());
#else
EXPECT_EQ("Scene_Material_Diffuse", mat->TextureImage());
#endif
EXPECT_NE(nullptr, mat->TextureData());
delete mesh;
}
Expand Down

0 comments on commit b991f71

Please sign in to comment.