Skip to content
Snippets Groups Projects
Commit db5f7bd8 authored by Campbell Barton's avatar Campbell Barton
Browse files

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

parent 0a5c9954
Branches
Tags
No related merge requests found
...@@ -313,9 +313,15 @@ EXPORT_GROUP_BY_OB=False, EXPORT_GROUP_BY_MAT=False): ...@@ -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.getMaterials(1) # 1 == will return None in the list.
materials = m.materials materials = m.materials
materialNames = []
if materials: 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: else:
materialNames = [] materialNames = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment