gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Fix tutorial for `blender_sdf_exporter`

Open AndrejOrsula opened this issue 2 years ago • 0 comments

🦟 Bug fix

Summary

I encountered 2 issues when trying the tutorial.

  1. The COLLADA (.dae) would get exported correctly under ./meshes/model.dae. However, SDF file refer to ./model.dae as a relative URI for the mesh, which prevented Gazebo from finding it (assuming that only the parent directory of the model is part of GZ_SIM_RESOURCE_PATH). Corrected the path.
  2. The script always expected a model to have an assigned material, which would make it fail for objects without any material. Added a simple check to prevent throwing an exception when exporting models without a material.

Tested both with Blender 2.82 and 3.2

Checklist

  • [x] Signed all commits for DCO
  • [ ] Added tests
  • [ ] Updated documentation (as needed)
  • [ ] Updated migration guide (as needed)
  • [ ] Consider updating Python bindings (if the library has them)
  • [ ] codecheck passed (See contributing)
  • [ ] All tests passed (See test coverage)
  • [ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

AndrejOrsula avatar Sep 16 '22 19:09 AndrejOrsula