diff options
author | Matt Ebb <matt@mke3.net> | 2010-03-17 06:07:37 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-03-17 06:07:37 +0300 |
commit | 1d4b93214520045e67eb535393d6056f41feaa54 (patch) | |
tree | 12689cfa1aa012673263b8d9cf452cfb0bdeca0a /release | |
parent | 504a7e9d3fb202ac5353cf596f978288c84af754 (diff) |
Fix [#21553] Re-Projection just opening the image editor but not the image.
Campbell please check/beautify if you like, but it works properly on OS X, either
opening Preview with the 'open' command or Photoshop, when the path is set
in user preferences.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/image.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index 0d20a9639b9..02d8fcc3219 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -22,19 +22,25 @@ import bpy def image_editor_guess(context): + import platform + system = platform.system() + image_editor = context.user_preferences.filepaths.image_editor # use image editor in the preferences when available. if not image_editor: - import platform - system = platform.system() - if system == 'Windows': - image_editor = "start" # not tested! + image_editor = ["start"] # not tested! elif system == 'Darwin': - image_editor = "open" + image_editor = ["open"] else: - image_editor = "gimp" + image_editor = ["gimp"] + else: + if system == 'Darwin': + # blender file selector treats .app as a folder + # and will include a trailing backslash, so we strip it. + image_editor.rstrip('\\') + image_editor = ["open", "-a", image_editor] return image_editor @@ -118,7 +124,11 @@ class ProjectEdit(bpy.types.Operator): image_new.file_format = 'PNG' image_new.save() - subprocess.Popen([image_editor, bpy.utils.expandpath(filename_final)]) + cmd = [] + cmd.extend(image_editor) + cmd.append(bpy.utils.expandpath(filename_final)) + + subprocess.Popen(cmd) return {'FINISHED'} |