From c3a7f59ec1bcf33cf2c532d035e2c689c852150b Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 27 Jul 2024 16:18:15 +0300 Subject: [PATCH] Skip empty material slots on a Mesh They may occur if materials are intended to be supplied by the object instead of the mesh. --- blender/io_mspgl/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index 8ad77bda..c0d9c11b 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -194,6 +194,8 @@ class Mesh: has_normal_maps = False splat_material = None for m in self.materials: + if not m: + continue mat = Material(m) for p in itertools.chain(mat.properties, *(s.properties for s in mat.sub_materials)): if p.tex_keyword=="normal_map" and p.texture: -- 2.45.2