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
This commit is contained in:
Shinsuke Irie 2013-09-30 16:18:56 +00:00
parent 06c6d3235c
commit aec7017211
1 changed files with 6 additions and 1 deletions

View File

@ -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;