Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invisible meshes (fix #74) #75

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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