diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 09:53:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-06 10:03:29 +0300 |
commit | 2a184f3d2b6cc180fedd0c93c266d847f7d27936 (patch) | |
tree | 5d7472cb10888e6e18dd64bbcdb3c078ac325ca0 /source/blender/editors/sculpt_paint/paint_vertex_color_ops.c | |
parent | 906ed54d286d0dd6686aac997883e7dfa4bba792 (diff) |
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex_color_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_color_ops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c index d7668a48139..83407ba6765 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c @@ -51,9 +51,11 @@ static int vertex_weight_paint_mode_poll(bContext *C) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Object *ob = CTX_data_active_object(C); Mesh *me = BKE_mesh_from_object(ob); - return (ob && (ob->mode == OB_MODE_VERTEX_PAINT || ob->mode == OB_MODE_WEIGHT_PAINT)) && + return (ob && ELEM(eval_ctx.object_mode, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT)) && (me && me->totpoly && me->dvert); } |