Skip to content

Commit

Permalink
Merge pull request #75 from Tobias-Fischer/fix-invisible-meshes
Browse files Browse the repository at this point in the history
Fix invisible meshes (fix #74)
  • Loading branch information
Tobias-Fischer authored May 10, 2021
2 parents f3c6d40 + d83481a commit 4977a42
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions recipe/fix-invisible-meshes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/gazebo/rendering/Visual.cc b/gazebo/rendering/Visual.cc
index 14ee82bc5c..d8df743a8b 100644
--- a/gazebo/rendering/Visual.cc
+++ b/gazebo/rendering/Visual.cc
@@ -626,6 +626,7 @@ void Visual::DetachVisual(const std::string &_name)
//////////////////////////////////////////////////
void Visual::AttachObject(Ogre::MovableObject *_obj)
{
+ static std::atomic_uint64_t id = 0;
// This code makes plane render before grids. This allows grids to overlay
// planes, and then other elements to overlay both planes and grids.
// if (this->dataPtr->sdf->HasElement("geometry"))
@@ -647,7 +648,7 @@ void Visual::AttachObject(Ogre::MovableObject *_obj)
{
std::string newMaterialName;
newMaterialName = this->dataPtr->sceneNode->getName() +
- "_MATERIAL_" + material->getName();
+ "_MATERIAL_" + material->getName() + "_" + boost::lexical_cast<std::string>(id++);

// keep a pointer to the original submesh material so it can be used
// to restore material state when setting transparency
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ source:
- use-external-libs-config.patch
- normalize-ogre-path.patch
- fix-windows-model-insert.patch
- fix-invisible-meshes.patch

build:
number: 0
number: 1
skip: false
run_exports:
- {{ pin_subpackage('gazebo', max_pin='x') }}
Expand Down

0 comments on commit 4977a42

Please sign in to comment.