diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-01 17:55:41 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-01 17:55:41 +0400 |
commit | 81d9a3de4302e0d4722d75d727fbc9e9c626bd9e (patch) | |
tree | df8d921aabec85fe980e087d7951526dc2bc28c7 /release | |
parent | b49bd51bc827e39e5d02606ccaedbc037dd4896f (diff) |
* add missing imports
* fix indentation: tabs -> spaces
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/io_utils.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/release/scripts/modules/io_utils.py b/release/scripts/modules/io_utils.py index db783dd1054..9492814009e 100644 --- a/release/scripts/modules/io_utils.py +++ b/release/scripts/modules/io_utils.py @@ -18,32 +18,34 @@ # <pep8 compliant> +import bpy from bpy.props import * class ExportHelper: - filepath = StringProperty(name="File Path", description="Filepath used for exporting the file", maxlen= 1024, default= "", subtype='FILE_PATH') - check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) + filepath = StringProperty(name="File Path", description="Filepath used for exporting the file", maxlen= 1024, default= "", subtype='FILE_PATH') + check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'}) - def invoke(self, context, event): - import os - if not self.properties.is_property_set("filepath"): - self.properties.filepath = os.path.splitext(context.main.filepath)[0] + self.filename_ext + def invoke(self, context, event): + import os + if not self.properties.is_property_set("filepath"): + self.properties.filepath = os.path.splitext(context.main.filepath)[0] + self.filename_ext - context.manager.add_fileselect(self) - return {'RUNNING_MODAL'} + context.manager.add_fileselect(self) + return {'RUNNING_MODAL'} class ImportHelper: - filepath = StringProperty(name="File Path", description="Filepath used for importing the file", maxlen= 1024, default= "", subtype='FILE_PATH') + filepath = StringProperty(name="File Path", description="Filepath used for importing the file", maxlen= 1024, default= "", subtype='FILE_PATH') - def invoke(self, context, event): - wm = context.manager - wm.add_fileselect(self) - return {'RUNNING_MODAL'} + def invoke(self, context, event): + wm = context.manager + wm.add_fileselect(self) + return {'RUNNING_MODAL'} # limited replacement for BPyImage.comprehensiveImageLoad def load_image(imagepath, dirname): + import os if os.path.exists(imagepath): return bpy.data.images.load(imagepath) @@ -98,4 +100,4 @@ def unpack_face_list(list_of_tuples): flat_ls[i:i + len(t)] = t i += 4 - return flat_ls
\ No newline at end of file + return flat_ls |