]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_texture.py
Always export texture data inline if there's no image file
[libs/gl.git] / blender / io_mspgl / export_texture.py
index 23c5777d39ce4b2e92401bacda2ebc0da4e74c68..0a43ce624cfb296348e9a08c2cf4ada186f8068f 100644 (file)
@@ -1,3 +1,5 @@
+import os
+
 class TextureExporter:
        def __init__(self):
                self.inline_data = True
@@ -20,9 +22,9 @@ class TextureExporter:
                        else:
                                tex_res.statements.append(Statement("min_filter", Token('NEAREST')))
 
-               if not self.inline_data:
+               if not self.inline_data and texture.image.filepath:
                        from .util import image_name
-                       tex_res.statements.append(Statement("external_image", image_name(texture.image)))
+                       tex_res.statements.append(Statement("external_image", os.path.basename(texture.image.filepath)))
                else:
                        texdata = ""
                        colorspace = texture.image.colorspace_settings.name