diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-11 20:16:03 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-11 20:16:03 +0300 |
commit | bb3168afbe54e282873cd72d84bd16ee9ecb6d22 (patch) | |
tree | 87a09f73102793874500421342009a6d657d51af /source/blender/editors/sculpt_paint | |
parent | 8da10f59eb10d2ee135f270c0e1a9ccd20f4f300 (diff) |
re-project paint failed on no-camera when a camera wasnt needed.
(revision 27388 from render25 branch)
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index faff64fc550..bcfb2fedb12 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5374,11 +5374,6 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - if(scene->camera==NULL) { - BKE_report(op->reports, RPT_ERROR, "No active camera set."); - return OPERATOR_CANCELLED; - } - if(image==NULL) { BKE_report(op->reports, RPT_ERROR, "Image could not be found."); return OPERATOR_CANCELLED; @@ -5392,15 +5387,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - /* override */ - ps.is_texbrush= 0; - ps.is_airbrush= 1; - orig_brush_size= ps.brush->size; - ps.brush->size= 32; /* cover the whole image */ - - ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */ - idgroup= IDP_GetProperties(&image->id, 0); + if(idgroup) { view_data= IDP_GetPropertyFromGroup(idgroup, PROJ_VIEW_DATA_ID); @@ -5411,15 +5399,27 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) } } - if(view_data) { /* image has stored view projection info */ ps.source= PROJ_SRC_IMAGE_VIEW; } else { ps.source= PROJ_SRC_IMAGE_CAM; + + if(scene->camera==NULL) { + BKE_report(op->reports, RPT_ERROR, "No active camera set."); + return OPERATOR_CANCELLED; + } } + /* override */ + ps.is_texbrush= 0; + ps.is_airbrush= 1; + orig_brush_size= ps.brush->size; + ps.brush->size= 32; /* cover the whole image */ + + ps.tool= PAINT_TOOL_DRAW; /* so pixels are initialized with minimal info */ + scene->toolsettings->imapaint.flag |= IMAGEPAINT_DRAWING; undo_paint_push_begin(UNDO_PAINT_IMAGE, "Image Paint", |