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>2011-08-03 09:32:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-08-03 09:32:07 +0400
commita10245a1fa0243cc2e8bb739b589693fc26aa2c8 (patch)
tree9e81d708764572e1bd7d015db2bed813edc916f6 /release/scripts/modules/bpy_extras/io_utils.py
parent6233430c2378dc25671426a569ca084f914dda48 (diff)
fix [#28151] export OBJ don't save the extension
also correct some typos
Diffstat (limited to 'release/scripts/modules/bpy_extras/io_utils.py')
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py35
1 files changed, 24 insertions, 11 deletions
diff --git a/release/scripts/modules/bpy_extras/io_utils.py b/release/scripts/modules/bpy_extras/io_utils.py
index f476b371d0c..45664384efa 100644
--- a/release/scripts/modules/bpy_extras/io_utils.py
+++ b/release/scripts/modules/bpy_extras/io_utils.py
@@ -37,6 +37,15 @@ import bpy
from bpy.props import StringProperty, BoolProperty, EnumProperty
+def _check_axis_conversion(op):
+ if hasattr(op, "axis_forward") and hasattr(op, "axis_up"):
+ return axis_conversion_ensure(op,
+ "axis_forward",
+ "axis_up",
+ )
+ return False
+
+
class ExportHelper:
filepath = StringProperty(
name="File Path",
@@ -70,21 +79,22 @@ class ExportHelper:
return {'RUNNING_MODAL'}
def check(self, context):
+ change_ext = False
+ change_axis = _check_axis_conversion(self)
+
check_extension = self.check_extension
- if check_extension is None:
- return False
+ if check_extension is not None:
+ filepath = bpy.path.ensure_ext(self.filepath,
+ self.filename_ext
+ if check_extension
+ else "")
- filepath = bpy.path.ensure_ext(self.filepath,
- self.filename_ext
- if check_extension
- else "")
+ if filepath != self.filepath:
+ self.filepath = filepath
+ change_ext = True
- if filepath != self.filepath:
- self.filepath = filepath
- return True
-
- return False
+ return (change_ext or change_axis)
class ImportHelper:
@@ -99,6 +109,9 @@ class ImportHelper:
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
+ def check(self, context):
+ return _check_axis_conversion(self)
+
# Axis conversion function, not pretty LUT
# use lookup tabes to convert between any axis