]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_material.py
Fix exporting of materials without any textures
[libs/gl.git] / blender / io_mspgl / export_material.py
index d69389cc2e024e52a304d1fcb6171bcc5e0ceaa0..4d2fe0749c71456fba465256a6e16ee8a5d28f06 100644 (file)
@@ -73,11 +73,11 @@ class MaterialExporter:
                        if ss:
                                st.sub.append(ss)
                if self.use_textures:
-                       first_tex = (p.texture for p in material.properties if p.texture).__next__()
-                       if first_tex and not first_tex.default_filter:
+                       textures = [p.texture for p in material.properties if p.texture]
+                       if textures and not textures[0].default_filter:
                                from .export_texture import SamplerExporter
                                sampler_export = SamplerExporter()
-                               st.sub.append(mat_res.create_reference_statement("sampler", resources[sampler_export.get_sampler_name(first_tex)]))
+                               st.sub.append(mat_res.create_reference_statement("sampler", resources[sampler_export.get_sampler_name(textures[0])]))
                mat_res.statements.append(st)
 
                return mat_res