dfki-ric / phobos

An add-on for Blender allowing to create URDF, SDF and SMURF robot models in a WYSIWYG environment.
BSD 3-Clause "New" or "Revised" License
709 stars 113 forks source link

"Create Inertials" fails if not all vertices are selected #351

Closed kevinfoley closed 6 months ago

kevinfoley commented 8 months ago

Summary: The "Create Inertials" operation fails unless all of the vertices in a visual geometry object are selected.

Steps to Reproduce:

  1. Open the attached Blend file.
  2. Select the Base object (the cube centered at 0,0,0)
  3. Press Tab to enter Edit mode
  4. Press the A key until no vertices are selected
  5. Press Tab to exit Edit mode
  6. Click "Create Inertials"
  7. Observe that Phobos displays a divide-by-zero error
  8. Press Tab to enter Edit mode
  9. Select some, but not all, of the vertices
  10. Press Tab to exit Edit mode
  11. Click "Create Inertials"
  12. Observe that Phobos displays an error "operands could not be broadcast together with shapes"

Expected result: The Create Inertials operation succeeds regardless of which vertices are selected in the mesh. Actual result: See steps 7 and 12 above.

Workaround:

  1. Press Tab to enter Edit mode
  2. Press the A key until all vertices are selected
  3. Press Tab to exit Edit mode
  4. Click "Create Inertials"

Environment:

AlpenAalAlex commented 8 months ago

@kevinfoley Interesting find thank you. I could not reproduce step 7. Please take a look at my commit and see if it fixes it anyway

kevinfoley commented 8 months ago

@AlpenAalAlex Your fix appears to work. Thanks!