[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35846] trunk/blender/release/scripts/ startup/bl_operators/image.py: Address [#26641] Texture Quick Edit kicks up error when Editor can't be found
Nathan Letwory
nathan at letworyinteractive.com
Mon Mar 28 15:44:57 CEST 2011
Revision: 35846
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35846
Author: jesterking
Date: 2011-03-28 13:44:56 +0000 (Mon, 28 Mar 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_operators/image.py
Modified: trunk/blender/release/scripts/startup/bl_operators/image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/image.py 2011-03-28 12:16:20 UTC (rev 35845)
+++ trunk/blender/release/scripts/startup/bl_operators/image.py 2011-03-28 13:44:56 UTC (rev 35846)
@@ -60,12 +60,18 @@
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 @@
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 @@
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 @@
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'}
More information about the Bf-blender-cvs
mailing list