[Bf-blender-cvs] [5958dd4098e] master: Fix T60101: vertex paint color sample
Sebastian Parborg
noreply at git.blender.org
Thu Jan 3 22:27:25 CET 2019
Commit: 5958dd4098e74d58665629bf341396ab82ca5b02
Author: Sebastian Parborg
Date: Fri Jan 4 08:02:17 2019 +1100
Branches: master
https://developer.blender.org/rB5958dd4098e74d58665629bf341396ab82ca5b02
Fix T60101: vertex paint color sample
===================================================================
M source/blender/editors/sculpt_paint/paint_image.c
M source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 30efcd2cb9a..b8ac4403e1d 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -302,7 +302,7 @@ static bool image_paint_poll(bContext *C)
return image_paint_poll_ex(C, true);
}
-static bool image_paint_ignore_tool_poll(bContext *C)
+static bool image_paint_poll_ignore_tool(bContext *C)
{
return image_paint_poll_ex(C, false);
}
@@ -1022,6 +1022,11 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
+static bool sample_color_poll(bContext *C)
+{
+ return (image_paint_poll_ignore_tool(C) || vertex_paint_poll_ignore_tool(C));
+}
+
void PAINT_OT_sample_color(wmOperatorType *ot)
{
/* identifiers */
@@ -1033,7 +1038,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_ignore_tool_poll;
+ ot->poll = sample_color_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f5c49c4b7e1..f91c5f71b2f 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -246,7 +246,7 @@ bool vertex_paint_poll(bContext *C)
bool vertex_paint_poll_ignore_tool(bContext *C)
{
- return vertex_paint_poll_ex(C, true);
+ return vertex_paint_poll_ex(C, false);
}
bool weight_paint_mode_poll(bContext *C)
More information about the Bf-blender-cvs
mailing list