diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-11-17 09:30:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2010-11-17 09:30:06 +0300 |
commit | d0d16ecaeed0e6628d9ce18ba0808dedd992d44f (patch) | |
tree | f456054332bfe163bb5bee0f825d8d50c71d8a64 /source | |
parent | 1bb98b41944dadf69645cf3b99bcabd9834f9240 (diff) |
Fix #22645: Texture paint: soften tool does draw brushes
Disable projection painting for soften tools.
Also it looks like smear tools support projection in the code, so
enabled project paint menu for such tools
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index c5402a00942..3e020e2a18c 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4526,6 +4526,8 @@ typedef struct PaintOperation { ViewContext vc; wmTimer *timer; + + short restore_projection; } PaintOperation; static void paint_redraw(bContext *C, ImagePaintState *s, int final) @@ -4611,6 +4613,13 @@ static int texture_paint_init(bContext *C, wmOperator *op) pop->first= 1; op->customdata= pop; + /* XXX: Soften tool does not support projection painting atm, so just disable + projection for this brush */ + if(brush->imagepaint_tool == PAINT_TOOL_SOFTEN) { + settings->imapaint.flag |= IMAGEPAINT_PROJECT_DISABLE; + pop->restore_projection = 1; + } + /* initialize from context */ if(CTX_wm_region_view3d(C)) { pop->mode= PAINT_MODE_3D; @@ -4731,6 +4740,9 @@ static void paint_exit(bContext *C, wmOperator *op) if(pop->timer) WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), pop->timer); + if(pop->restore_projection) + settings->imapaint.flag &= ~IMAGEPAINT_PROJECT_DISABLE; + settings->imapaint.flag &= ~IMAGEPAINT_DRAWING; imapaint_canvas_free(&pop->s); brush_painter_free(pop->painter); |