Fix T85688: ExportHelper adds multiple file name extensions
Replace the existing extension instead of adding it.
This commit is contained in:
parent
718109e7f0
commit
0b6892f0ba
Notes:
blender-bot
2023-02-14 06:37:09 +01:00
Referenced by issue #85688, ExportHelper: filename_ext change is appended to the previous name + ext instead of changing ext
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue