diff options
author | Irie Shinsuke <irieshinsuke@yahoo.co.jp> | 2013-09-30 20:18:56 +0400 |
---|---|---|
committer | Irie Shinsuke <irieshinsuke@yahoo.co.jp> | 2013-09-30 20:18:56 +0400 |
commit | aec701721184c711a54632a0849ba9d8386f52d4 (patch) | |
tree | 2622ea82387551304a1c8839fec4f3d8a32c9b75 /source/blender/editors/sculpt_paint/paint_image.c | |
parent | 06c6d3235caf9001c5be5318a30261728cf71466 (diff) |
Fix "Sample Color" not working in vertex paint mode.
The issue was discussed at blender.org forum:
http://www.blender.org/forum/viewtopic.php?t=28158
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index a32293ab12b..910a49a8f7d 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -963,6 +963,11 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } +static int sample_color_poll(bContext *C) +{ + return (image_paint_poll(C) || vertex_paint_poll(C)); +} + void PAINT_OT_sample_color(wmOperatorType *ot) { /* identifiers */ @@ -974,7 +979,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 = sample_color_poll; /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; |