Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-04-28 15:53:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-28 16:00:53 +0300
commit0b6892f0ba114e6b3dfd40aac2727b4b1efacb66 (patch)
tree9dbc10ceda41a59772754eef61f949d96b53442d /release
parent718109e7f090794dd37887583c266fc579eeaaf2 (diff)
Fix T85688: ExportHelper adds multiple file name extensions
Replace the existing extension instead of adding it.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index 19697b25f70..7eb9b2aa347 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -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