Fix T85688: ExportHelper adds multiple file name extensions

Replace the existing extension instead of adding it.
This commit is contained in:
2021-04-28 22:53:35 +10:00
parent 718109e7f0
commit 0b6892f0ba

View File

@@ -94,13 +94,11 @@ class ExportHelper:
if check_extension is not None:
filepath = self.filepath
if os.path.basename(filepath):
filepath = bpy.path.ensure_ext(
filepath,
self.filename_ext
if check_extension
else "",
)
if check_extension:
filepath = bpy.path.ensure_ext(
os.path.splitext(filepath)[0],
self.filename_ext,
)
if filepath != self.filepath:
self.filepath = filepath
change_ext = True