From db5f7bd8da580d05c31f6fa65bfea8042deac10e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 27 Jan 2006 14:55:12 +0000 Subject: [PATCH] Fixed a stupid bug when exporting meshes with empty material slots. --- release/scripts/obj_export.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/release/scripts/obj_export.py b/release/scripts/obj_export.py index 2be57884cee..b57343e36dc 100644 --- a/release/scripts/obj_export.py +++ b/release/scripts/obj_export.py @@ -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 = [] -- 2.28.0