mitsuba-renderer/mitsuba-blender

Robustness to bad inputs

dvicini opened this issue · 0 comments

Hello,

I've been trying to export some scenes that I did not make myself. I encountered two issues that would be nice to fix:

  1. The exporter fails if a mesh does not have any material assigned to it. This can happen if you have a complex scene that was created by combining many different assets. In that case, I think it would be reasonable to just export a black diffuse material. This should be easy to fix - it manifests as an indexing error on the Python side.
  2. The exporter is quite sensitive to bad meshes. In particular, I've found my scene to often trigger an "invalid normals!" error (in blender.cpp). I think this happens with (some) zero area faces or other degenerate faces. While some of this can be cleaned up using various tools in Blender, I think it would be better if the exporter was a bit more robust to those. Could we in this case create some dummy normal? Or maybe compute the normal from valid neighbors? Not sure what's the best solution here.

I've attached a test scene with two cubes. One is an example of problem 1, and the other has problem 2.

blender_exporter_debug.blend.zip