Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-08-02 14:25:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-02 14:25:12 +0400
commit888e3c02872d5d33b93356ddf98808e71c85ca83 (patch)
tree84a4d9b53e3ca7cc60ead2f4f857aa9b4f426254 /io_scene_obj
parent466c62ac401272b897744d2203b5c9fa4502c391 (diff)
fix [#28146] OBJ fails when mehs has no material
Diffstat (limited to 'io_scene_obj')
-rw-r--r--io_scene_obj/export_obj.py5
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: