Skip to content

Commit

Permalink
Avoid redefinition of default color materials (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
Masa0u0 authored Sep 26, 2024
1 parent 9937975 commit 8e757c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rviz_rendering/src/rviz_rendering/material_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ namespace rviz_rendering
void MaterialManager::createColorMaterial(
const std::string & name, const Ogre::ColourValue & color, bool use_self_illumination)
{
if (Ogre::MaterialManager::getSingleton().resourceExists(name, "rviz_rendering")) {
return;
}
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(name, "rviz_rendering");
mat->setAmbient(color * 0.5f);
mat->setDiffuse(color);
Expand Down

0 comments on commit 8e757c2

Please sign in to comment.