Skip to content
Snippets Groups Projects
Commit 888e3c02 authored by Campbell Barton's avatar Campbell Barton
Browse files

fix [#28146] OBJ fails when mehs has no material

parent 466c62ac
No related branches found
No related tags found
No related merge requests found
......@@ -383,6 +383,11 @@ def write_file(filepath, objects, scene,
materials = me.materials[:]
material_names = [m.name if m else None for m in materials]
# avoid bad index errors
if not materials:
materials = [None]
material_names = [""]
# Sort by Material, then images
# so we dont over context switch in the obj file.
if EXPORT_KEEP_VERT_ORDER:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment