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:
authorJoerg Mueller <nexyon@gmail.com>2011-08-03 16:44:52 +0400
committerJoerg Mueller <nexyon@gmail.com>2011-08-03 16:44:52 +0400
commiteb9d591898e93dbbe9e28865018175b9da730596 (patch)
tree3209caefe505273e834a936e54f6146a4185e83b /release/scripts/modules
parent6d7490632f13f9744c6b3e507c838a34f3481846 (diff)
parentf1fb54e126824ff38b8bf26fa80f3f46c886bd45 (diff)
* Merging trunk up to r38981.
* Fixing a minor issue in a previous commit.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/bpy/path.py4
-rw-r--r--release/scripts/modules/bpy_extras/io_utils.py35
2 files changed, 26 insertions, 13 deletions
diff --git a/release/scripts/modules/bpy/path.py b/release/scripts/modules/bpy/path.py
index a01745fec0a..284fef97795 100644
--- a/release/scripts/modules/bpy/path.py
+++ b/release/scripts/modules/bpy/path.py
@@ -136,7 +136,7 @@ def display_name(name):
def display_name_from_filepath(name):
"""
- Returns the path stripped of directort and extension,
+ Returns the path stripped of directory and extension,
ensured to be utf8 compatible.
"""
name = _os.path.splitext(basename(name))[0]
@@ -204,7 +204,7 @@ def resolve_ncase(path):
def ensure_ext(filepath, ext, case_sensitive=False):
"""
- Return the path with the extension added its its not alredy set.
+ Return the path with the extension added if it is not already set.
:arg ext: The extension to check for.
:type ext: string
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