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:
Diffstat (limited to 'release/scripts/op/image.py')
-rw-r--r--release/scripts/op/image.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py
index ca7a017febd..e1d471f8254 100644
--- a/release/scripts/op/image.py
+++ b/release/scripts/op/image.py
@@ -32,13 +32,17 @@ class EditExternally(bpy.types.Operator):
def _editor_guess(self, context):
import platform
- system = platform.system()
+ try:
+ system = platform.system()
+ except UnicodeDecodeError:
+ import sys
+ system = sys.platform
image_editor = context.user_preferences.filepaths.image_editor
# use image editor in the preferences when available.
if not image_editor:
- if system == 'Windows':
+ if system in ('Windows', 'win32'):
image_editor = ["start"] # not tested!
elif system == 'Darwin':
image_editor = ["open"]
@@ -84,7 +88,7 @@ class EditExternally(bpy.types.Operator):
class SaveDirty(bpy.types.Operator):
- '''Select object matching a naming pattern'''
+ """Save all modified textures"""
bl_idname = "image.save_dirty"
bl_label = "Save Dirty"
bl_options = {'REGISTER', 'UNDO'}
@@ -105,7 +109,7 @@ class SaveDirty(bpy.types.Operator):
class ProjectEdit(bpy.types.Operator):
- '''Select object matching a naming pattern'''
+ """Edit a snapshot if the viewport in an external image editor"""
bl_idname = "image.project_edit"
bl_label = "Project Edit"
bl_options = {'REGISTER'}
@@ -139,7 +143,7 @@ class ProjectEdit(bpy.types.Operator):
# filepath = bpy.path.clean_name(filepath) # fixes <memory> rubbish, needs checking
if filepath.startswith(".") or filepath == "":
- # TODO, have a way to check if the file is saved, assume .B25.blend
+ # TODO, have a way to check if the file is saved, assume startup.blend
tmpdir = context.user_preferences.filepaths.temporary_directory
filepath = os.path.join(tmpdir, "project_edit")
else:
@@ -170,7 +174,7 @@ class ProjectEdit(bpy.types.Operator):
class ProjectApply(bpy.types.Operator):
- '''Select object matching a naming pattern'''
+ """Project edited image back onto the object"""
bl_idname = "image.project_apply"
bl_label = "Project Apply"
bl_options = {'REGISTER'}
@@ -191,11 +195,11 @@ class ProjectApply(bpy.types.Operator):
def register():
- pass
+ bpy.utils.register_module(__name__)
def unregister():
- pass
+ bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()