]> git.tdb.fi Git - libs/gl.git/commitdiff
Skip empty material slots on a Mesh
authorMikko Rasa <tdb@tdb.fi>
Sat, 27 Jul 2024 13:18:15 +0000 (16:18 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 27 Jul 2024 13:18:15 +0000 (16:18 +0300)
They may occur if materials are intended to be supplied by the object
instead of the mesh.

blender/io_mspgl/mesh.py

index 8ad77bdafed3111e582578f2d885e3dfafb935f6..c0d9c11b872ee6e079e52dbb7d97648ec88c81fa 100644 (file)
@@ -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: