os.path.basename seems to consider the // prefix to indicate a UNC
path and will return an empty string if the path contains exactly
two components.
from .datafile import Statement
if self.use_textures and prop.texture:
tex_res = resources[prop.texture.image.name+".tex2d"]
- fn = os.path.basename(prop.texture.image.filepath)
+ from .util import basename
+ fn = basename(prop.texture.image.filepath)
if prop.texture.default_filter and fn:
return Statement(keyword+"_map", fn)
else:
if usage=='GRAY' and colorspace=='sRGB':
raise Exception("Grayscale textures with sRGB colorspace are not supported")
- fn = os.path.basename(image.filepath)
+ from .util import basename
+ fn = basename(image.filepath)
if not self.inline_data and fn:
srgb = "_srgb" if colorspace=='sRGB' else ""
tex_res.statements.append(Statement("external_image"+srgb, fn))
+import os
+
class Progress:
def __init__(self, context):
self.task = ""
return linear_to_srgb
else:
return lambda x: x
+
+def basename(path):
+ if path.startswith("//"):
+ path = path[2:]
+ return os.path.basename(path)