Skip to content

Commit

Permalink
Geometry: Check that mesh is not empty or null before trying to write…
Browse files Browse the repository at this point in the history
… it, when it doesn't have any assigned material
  • Loading branch information
bathal1 committed Mar 15, 2024
1 parent 635aa6a commit b4f3112
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mitsuba-blender/io/exporter/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,9 @@ def export_object(deg_instance, export_ctx, is_particle):


if mat_count == 0: # No assigned material
converted_parts.append((
name_clean,
-1,
convert_mesh(export_ctx, b_mesh, transform, name_clean, 0)
))
mts_mesh = convert_mesh(export_ctx, b_mesh, transform, name_clean, 0)
if mts_mesh is not None and mts_mesh.face_count() > 0:
converted_parts.append((name_clean, -1, mts_mesh))
else:
refs_per_mat = {}
for mat_nr in range(mat_count):
Expand Down

0 comments on commit b4f3112

Please sign in to comment.