diff options
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/export_obj.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py index 3c721643..b043ec6d 100644 --- a/io_scene_obj/export_obj.py +++ b/io_scene_obj/export_obj.py @@ -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: |