Skip to content

Commit

Permalink
warn about non-existent submesh (#391)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@osrfoundation.org>
  • Loading branch information
iche033 authored Aug 31, 2021
1 parent f65f2fa commit 622a7ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ogre/src/OgreMeshFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,15 @@ bool OgreMeshFactory::LoadImpl(const MeshDescriptor &_desc)
return false;
}

if (ogreMesh->getNumSubMeshes() == 0u)
{
std::string msg = "Unable to load mesh: '" + _desc.meshName + "'";
if (!_desc.subMeshName.empty())
msg += ", submesh: '" + _desc.subMeshName + "'";
msg += ". Mesh will be empty.";
ignwarn << msg << std::endl;
}

return true;
}

Expand Down
9 changes: 9 additions & 0 deletions ogre2/src/Ogre2MeshFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ bool Ogre2MeshFactory::LoadImpl(const MeshDescriptor &_desc)
return false;
}

if (ogreMesh->getNumSubMeshes() == 0u)
{
std::string msg = "Unable to load mesh: '" + _desc.meshName + "'";
if (!_desc.subMeshName.empty())
msg += ", submesh: '" + _desc.subMeshName + "'";
msg += ". Mesh will be empty.";
ignwarn << msg << std::endl;
}

return true;
}

Expand Down

0 comments on commit 622a7ba

Please sign in to comment.