gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
709 stars 269 forks source link

sdf_exporter blender issue #1348

Closed Kakcalu13 closed 2 years ago

Kakcalu13 commented 2 years ago

Environment

I found this sdf blender exporter: https://ignitionrobotics.org/api/gazebo/6.0/blender_sdf_exporter.html So, I did the exact same steps. Here is what I did prior to this tutorial: 1. Download blender 2.82 2. Create a new folder called "blender_gazebo" 3. nano sdf_exporter.py 4. copy from https://raw.githubusercontent.com/ignitionrobotics/ign-gazebo/ign-gazebo5/examples/scripts/blender/sdf_exporter.py and paste into that file 5. chmod a+x sdf_exporter.py 6. Open blender 2.8 7. Created a simple model (see the screenshot) ![image](https://user-images.githubusercontent.com/65916520/154413513-392568be-4e94-451d-aa75-d36790f34f9b.png) 8. Click Scripting tab 9. Click Open text 10. Click sdf_exporter.py 11. Click run script (or alt + p shortcuts) 12. It asked me where to save so I navigate to blender_gazebo 13. Click there 14. Error displays ![image](https://user-images.githubusercontent.com/65916520/154413966-b2b353ed-8c28-49b7-8891-d0c1814db2eb.png) ``` Traceback (most recent call last): File "/home/bwuk/untitled.blend/Text", line 194, in execute File "/home/bwuk/untitled.blend/Text", line 56, in export_sdf AttributeError: 'NoneType' object has no attribute 'node_tree' location: :-1 ``` I have no idea what node_tree is. But it generated .dae only See the full code: https://pastebin.com/b5E8qY5F It doesn't look like Fortress format. So I thought to myself, maybe I can try. So I put a section like this: ``` model_from_blender 0.0 0.0 10 0 0 0 model://model.dae ``` And it returns this: ``` [Err] [Server.cc:183] Error Code 1: [/sdf/world[@name="free_world"]/include[0]/uri:/home/bwuk/feagi/third_party/gazebo/smart_car/freenove_4wd_car_description/models/sdf/freenove_smart_car.sdf:L74]: Msg: Unable to read file[model.dae] [Err] [Server.cc:183] Error Code 9: [/sdf/world[@name="free_world"]:/home/bwuk/feagi/third_party/gazebo/smart_car/freenove_4wd_car_description/models/sdf/freenove_smart_car.sdf:L3]: Msg: Error reading element [Err] [Server.cc:183] Error Code 9: Msg: Error reading element [Err] [Server.cc:183] Error Code 1: Msg: Unable to read file:/home/bwuk/feagi/third_party/gazebo/smart_car/freenove_4wd_car_description/models/sdf/freenove_smart_car.s ``` .DAE is not readbale to Fortress. So that made me believe that it did not generate fully. Is this a bug?

Description

More detail inside detail tag

Kakcalu13 commented 2 years ago

I suspect this might be python difference.

I will test it at home

Kakcalu13 commented 2 years ago

image

All I needed to do was to add material (black in my case). I will update sdf blender doc since it's necessary to add that information otherwise it wouldn't work

Kakcalu13 commented 2 years ago

Closing since it's not on ign's end.