]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_material.py
Handle certain shader graph patterns that occur in imported glTF files
[libs/gl.git] / blender / io_mspgl / export_material.py
index 8560984ea4457dd0d4afb5b93fc8c29e95c30eed..b0df347f7fb0a2af9f07014e16a60bd2023afae8 100644 (file)
@@ -75,7 +75,7 @@ class MaterialExporter:
                for p in textured_props:
                        ctx.next_slice(p.texture.image)
 
-                       tex_name = p.texture.image.name+".tex"
+                       tex_name = texture_export.get_texture_name(p.texture, p.tex_channels)
                        if tex_name not in resources:
                                resources[tex_name] = texture_export.export_texture(p.texture, p.tex_channels)
 
@@ -121,7 +121,9 @@ class MaterialExporter:
        def create_property_statement(self, mat_res, prop, resources):
                from .datafile import Statement
                if prop.texture:
-                       tex_res = resources[prop.texture.image.name+".tex"]
+                       from .export_texture import TextureExporter
+                       texture_export = TextureExporter()
+                       tex_res = resources[texture_export.get_texture_name(prop.texture, prop.tex_channels)]
                        return mat_res.create_reference_statement(prop.tex_keyword, tex_res)
                elif not prop.keyword:
                        return