From: Mikko Rasa Date: Wed, 3 Jul 2019 16:35:05 +0000 (+0300) Subject: Correctly process meshes with empty material slots X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7ffc6b595b9c8405d1044f8a4d4d3098392e13fa;p=libs%2Fgl.git Correctly process meshes with empty material slots This may happen if materials are defined on the object rather than on the mesh. --- 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)