From 7ffc6b595b9c8405d1044f8a4d4d3098392e13fa Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 3 Jul 2019 19:35:05 +0300 Subject: [PATCH] Correctly process meshes with empty material slots This may happen if materials are defined on the object rather than on the mesh. --- blender/io_mspgl/export_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index 0e6a9022..6e399b01 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -105,7 +105,7 @@ class ObjectExporter: progress.push_task_slice("LOD {}".format(lod_index), i, len(lods)) material_map = None - mapped_count = sum(m.material_map for m in l.data.materials) + mapped_count = sum(m.material_map for m in l.data.materials if m) if mapped_count: material_map_tech = l.data.materials[0].technique tech_mismatch = any(m.technique!=material_map_tech for m in l.data.materials) -- 2.45.2