fix [#29063] reprojetion painting : failed to create opengl offscreen buffer
authorCampbell Barton <ideasman42@gmail.com>
Fri, 28 Oct 2011 02:10:02 +0000 (02:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 28 Oct 2011 02:10:02 +0000 (02:10 +0000)
error report was not passed into the UI and only printed into the terminal, now shows an error popup.

release/scripts/startup/bl_operators/image.py

index d0778dd..790c22d 100644 (file)
@@ -145,7 +145,11 @@ class ProjectEdit(Operator):
         for image in bpy.data.images:
             image.tag = True
 
         for image in bpy.data.images:
             image.tag = True
 
-        if 'FINISHED' not in bpy.ops.paint.image_from_view():
+        # opengl buffer may fail, we can't help this, but best report it.
+        try:
+            ret = bpy.ops.paint.image_from_view()
+        except RuntimeError as err:
+            self.report({'ERROR'}, str(err))
             return {'CANCELLED'}
 
         image_new = None
             return {'CANCELLED'}
 
         image_new = None