Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-09-16 19:54:48 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2010-09-16 19:54:48 +0400
commit2c79fa84b6642e4ec430f89f9a1c41496290f197 (patch)
tree997f90f64145db7b36f162e803a7b4b03d316863
parent19704f74b1ddc62b6c34aafb08e905a30ed60328 (diff)
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.
-rw-r--r--release/scripts/op/image.py3
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py
index 09c9f5e6881..ca7a017febd 100644
--- a/release/scripts/op/image.py
+++ b/release/scripts/op/image.py
@@ -121,7 +121,8 @@ class ProjectEdit(bpy.types.Operator):
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:
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 4760796fdff..3f1a5af76b1 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5494,6 +5494,13 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
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) {