diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-04 03:02:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-04 03:02:18 +0400 |
commit | 33a6ba99cab0059a2db3c379d77cab2427cb92a5 (patch) | |
tree | b94d696a871c8e3fa702894e30e4b23dc66db217 /release/scripts/op/image.py | |
parent | e2f5f4fa535e64f524082f31139fe358073f8281 (diff) |
exit image externally wasnt checking if the image existed first.
Diffstat (limited to 'release/scripts/op/image.py')
-rw-r--r-- | release/scripts/op/image.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py index bcef8b9afd3..27d9ea64c0c 100644 --- a/release/scripts/op/image.py +++ b/release/scripts/op/image.py @@ -56,13 +56,15 @@ class EditExternally(bpy.types.Operator): return image_editor def execute(self, context): + import os import subprocess - filepath = self.properties.filepath - image_editor = self._editor_guess(context) + filepath = bpy.utils.expandpath(self.properties.filepath) + + if not os.path.exists(filepath): + self.report('ERROR', "Image path '%s' not found." % filepath) + return {'CANCELLED'} - cmd = [] - cmd.extend(image_editor) - cmd.append(bpy.utils.expandpath(filepath)) + cmd = self._editor_guess(context) + [filepath] subprocess.Popen(cmd) |