[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31965] trunk/blender: Fix #22603: Crash on launching external editor in texture paint [r29461] [WinXP 32bit]
Sergey Sharybin
g.ulairi at gmail.com
Thu Sep 16 17:54:49 CEST 2010
Revision: 31965
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31965
Author: nazgul
Date: 2010-09-16 17:54:48 +0200 (Thu, 16 Sep 2010)
Log Message:
-----------
Fix #22603: Crash on launching external editor in texture paint [r29461] [WinXP 32bit]
Crash was caused by missed offscreen OpenGL buffer. Added checking around this stuff.
Also fixed crash of simple "Image from view operator".
Note: This commit fixes only crashing, you'll be still unable to use this tools.
Modified Paths:
--------------
trunk/blender/release/scripts/op/image.py
trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
Modified: trunk/blender/release/scripts/op/image.py
===================================================================
--- trunk/blender/release/scripts/op/image.py 2010-09-16 10:39:50 UTC (rev 31964)
+++ trunk/blender/release/scripts/op/image.py 2010-09-16 15:54:48 UTC (rev 31965)
@@ -121,7 +121,8 @@
for image in bpy.data.images:
image.tag = True
- bpy.ops.paint.image_from_view()
+ if 'FINISHED' not in bpy.ops.paint.image_from_view():
+ return {'CANCELLED'}
image_new = None
for image in bpy.data.images:
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2010-09-16 10:39:50 UTC (rev 31964)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2010-09-16 15:54:48 UTC (rev 31965)
@@ -5494,6 +5494,13 @@
if(h > maxsize) h= maxsize;
ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect);
+ if(!ibuf) {
+ /* Mostly happens when OpenGL offscreen buffer was failed to create, */
+ /* but could be other reasons. Should be handled in the future. nazgul */
+ BKE_report(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer.");
+ return OPERATOR_CANCELLED;
+ }
+
image= BKE_add_image_imbuf(ibuf);
if(image) {
More information about the Bf-blender-cvs
mailing list