Fix T41396: FBX export fails with some very simple material setups.

This commit is contained in:
Bastien Montagne 2014-08-11 13:03:43 +02:00
parent a88a2e6460
commit 07747bcf64
Notes: blender-bot 2023-02-14 20:04:16 +01:00
Referenced by issue #41396, FBX export fails with some very simple material setups
1 changed files with 2 additions and 1 deletions

View File

@ -1101,7 +1101,8 @@ def fbx_data_mesh_elements(root, me_obj, scene_data, done_meshes):
me.polygons.foreach_get("material_index", t_pm)
# We have to validate mat indices, and map them to FBX indices.
blmats_to_fbxmats_idxs = [me_fbxmats_idx[m] for m in me_blmats]
# Note a mat might not be in me_fbxmats_idx (e.g. node mats are ignored).
blmats_to_fbxmats_idxs = [me_fbxmats_idx[m] for m in me_blmats if m in me_fbxmats_idx]
mat_idx_limit = len(blmats_to_fbxmats_idxs)
def_mat = blmats_to_fbxmats_idxs[0]
_gen = (blmats_to_fbxmats_idxs[m] if m < mat_idx_limit else def_mat for m in t_pm)