Skip to content

Commit

Permalink
Fix opacity of Collada meshes (ros-visualization#1387)
Browse files Browse the repository at this point in the history
Fixes an issue introduced in ros-visualization#1294 (e906f82):
Materials of Collada mesh models need to be cloned for each instance of a robot link.
  • Loading branch information
rhaschke authored Jul 16, 2019
1 parent af8a870 commit f9b357f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rviz/robot/robot_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,13 @@ void RobotLink::createEntityForGeometryElement(const urdf::LinkConstSharedPtr& l
{
sub->setMaterial(default_material_);
}
else
{
// create a new material copy for each instance of a RobotLink
Ogre::MaterialPtr mat = Ogre::MaterialPtr(new Ogre::Material(nullptr, material_name, 0, ROS_PACKAGE_NAME));
*mat = *sub->getMaterial();
sub->setMaterial(mat);
}
materials_[sub] = sub->getMaterial();
}
}
Expand Down

0 comments on commit f9b357f

Please sign in to comment.