diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-02 16:32:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-02 16:32:28 +0400 |
commit | 354ca130f6b5d3ef9900558de73cabe2c54b1e73 (patch) | |
tree | 6c87aef009689d615c9e861ace5f06b34e74366b /source | |
parent | a2941a464b41c73f10ef3e559f509a9d4aefd3f5 (diff) |
enable face mask selection in texture paint mode again (worked in 2.4x).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 5caf72a4a2f..29bcb191b46 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5272,6 +5272,26 @@ static int sample_color_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } +/* same as image_paint_poll but fail when face mask mode is enabled */ +static int image_paint_sample_color_poll(bContext *C) +{ + if(image_paint_poll(C)) { + if(CTX_wm_view3d(C)) { + Object *obact = CTX_data_active_object(C); + if (obact && obact->mode & OB_MODE_TEXTURE_PAINT) { + Mesh *me= get_mesh(obact); + if(me) { + return !(me->editflag & ME_EDIT_PAINT_MASK); + } + } + } + + return 1; + } + + return 0; +} + void PAINT_OT_sample_color(wmOperatorType *ot) { /* identifiers */ @@ -5282,7 +5302,7 @@ void PAINT_OT_sample_color(wmOperatorType *ot) ot->exec= sample_color_exec; ot->invoke= sample_color_invoke; ot->modal= sample_color_modal; - ot->poll= image_paint_poll; + ot->poll= image_paint_sample_color_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |