diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-03-28 17:44:56 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-03-28 17:44:56 +0400 |
commit | 3916b0270e7aeff4bd0861aa4bb76f40633b606a (patch) | |
tree | 5ef7f81b595143125fa0ea1ac021bc9716460cbc /release/scripts/startup/bl_operators/image.py | |
parent | 713f976918d2ed00fb088430d2e417d7d055b693 (diff) |
Address [#26641] Texture Quick Edit kicks up error when Editor can't be found
reported by Keith Boshoff (Wahooney)
Instead of a confusing backtrace popup, tell the user the image editor cannot be found, and where to set the path to it.
Diffstat (limited to 'release/scripts/startup/bl_operators/image.py')
-rw-r--r-- | release/scripts/startup/bl_operators/image.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_operators/image.py b/release/scripts/startup/bl_operators/image.py index 82e631e31d2..65e0d5a52db 100644 --- a/release/scripts/startup/bl_operators/image.py +++ b/release/scripts/startup/bl_operators/image.py @@ -60,12 +60,18 @@ class EditExternally(bpy.types.Operator): filepath = bpy.path.abspath(self.filepath) if not os.path.exists(filepath): - self.report('ERROR', "Image path %r not found." % filepath) + self.report({'ERROR'}, "Image path %r not found." % filepath) return {'CANCELLED'} cmd = self._editor_guess(context) + [filepath] - subprocess.Popen(cmd) + try: + subprocess.Popen(cmd) + except: + import traceback + traceback.print_exc() + self.report({'ERROR'}, "Image editor not found, please specify in User Preferences > File") + return {'CANCELLED'} return {'FINISHED'} @@ -73,6 +79,8 @@ class EditExternally(bpy.types.Operator): try: filepath = context.space_data.image.filepath except: + import traceback + traceback.print_exc() self.report({'ERROR'}, "Image not found on disk") return {'CANCELLED'} @@ -163,7 +171,10 @@ class ProjectEdit(bpy.types.Operator): image_new.file_format = 'PNG' image_new.save() - bpy.ops.image.external_edit(filepath=filepath_final) + try: + bpy.ops.image.external_edit(filepath=filepath_final) + except RuntimeError as re: + self.report({'ERROR'}, str(re)) return {'FINISHED'} @@ -180,6 +191,8 @@ class ProjectApply(bpy.types.Operator): try: image = bpy.data.images[image_name] except KeyError: + import traceback + traceback.print_exc() self.report({'ERROR'}, "Could not find image '%s'" % image_name) return {'CANCELLED'} |