Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Transparency tag ignored when models loaded from world/programatically #1726

Closed
osrf-migration opened this issue Sep 2, 2015 · 5 comments
Closed
Labels
6.0 bug Something isn't working major rendering

Comments

@osrf-migration
Copy link

Original report (archived issue) by Cristian Dobra (Bitbucket: dobracristian).


Gazebo ignores transparency tag when models are loaded from world or programatically from a plugin, but if the models are inserted from Insert menu, the models are transparent.

Used files:

  • InsertBox.cc
#include "gazebo/physics/physics.hh"
#include "gazebo/common/common.hh"
#include "gazebo/gazebo.hh"

namespace gazebo
{
class InsertBox : public WorldPlugin
{
  public: void Load(physics::WorldPtr _parent, sdf::ElementPtr /*_sdf*/)
  {
    _parent->InsertModelFile("model://box");
  }
};
GZ_REGISTER_WORLD_PLUGIN(InsertBox)
}
  • insert_box.world
<?xml version="1.0"?>
<sdf version="1.4">
  <world name="default">
    <include>
      <uri>model://ground_plane</uri>
    </include>

    <include>
      <uri>model://sun</uri>
    </include>
    
     <include>
      <uri>model://box</uri>
       <pose>0 0 2 0 0 0</pose>
    </include>

    <plugin name="InsertBox" filename="libInsertBox.so"/>
  </world>
</sdf>
  • box.sdf
<?xml version="1.0"?>
<sdf version="1.4">
	
	 <model name="box">
      <pose>0 0 0.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </collision> 

        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
	         <transparency>0.5</transparency>
        </visual>
      </link>

	</model>        
</sdf>

tr2.png
The one from the left is added via drag and drop, the two from the right are from the world file.

@osrf-migration
Copy link
Author

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


pull request #1967

@osrf-migration
Copy link
Author

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


pull request #1987 to default (gazebo7)

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


See also #1790. Should I have posted that here?

@osrf-migration
Copy link
Author

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


  • changed state from "new" to "resolved"

pull request #2031

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "resolved" to "closed"

@osrf-migration osrf-migration added major rendering bug Something isn't working 6.0 labels Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
6.0 bug Something isn't working major rendering
Projects
None yet
Development

No branches or pull requests

1 participant