Fixed a stupid bug when exporting meshes with empty material slots.

This commit is contained in:
Campbell Barton 2006-01-27 14:55:12 +00:00
parent 0a5c995458
commit db5f7bd8da

@ -313,9 +313,15 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False):
#materials = m.getMaterials(1) # 1 == will return None in the list.
materials = m.materials
materialNames = []
if materials:
materialNames = map(lambda mat: mat.name, materials) # Bug Blender, dosent account for null materials, still broken.
for mat in materials:
if mat: # !=None
materialNames.append(mat.name)
else:
materialNames.append(None)
# Cant use LC because some materials are None.
# materialNames = map(lambda mat: mat.name, materials) # Bug Blender, dosent account for null materials, still broken.
else:
materialNames = []