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_ops.c | |
parent | 906ed54d286d0dd6686aac997883e7dfa4bba792 (diff) |
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 004d2757a71..214b260250d 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -40,6 +40,8 @@ #include "BKE_paint.h" #include "BKE_main.h" +#include "DEG_depsgraph.h" + #include "ED_paint.h" #include "ED_screen.h" #include "ED_image.h" @@ -261,6 +263,8 @@ static void PALETTE_OT_color_delete(wmOperatorType *ot) static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op)) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Paint *paint = BKE_paint_get_active_from_context(C); Brush *brush = BKE_paint_brush(paint); Object *ob = CTX_data_active_object(C); @@ -268,7 +272,7 @@ static int brush_reset_exec(bContext *C, wmOperator *UNUSED(op)) if (!ob || !brush) return OPERATOR_CANCELLED; /* TODO: other modes */ - if (ob->mode & OB_MODE_SCULPT) { + if (eval_ctx.object_mode & OB_MODE_SCULPT) { BKE_brush_sculpt_reset(brush); } else { @@ -401,6 +405,8 @@ static int brush_generic_tool_set(Main *bmain, Paint *paint, const int tool, static int brush_select_exec(bContext *C, wmOperator *op) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Main *bmain = CTX_data_main(C); ToolSettings *toolsettings = CTX_data_tool_settings(C); Paint *paint = NULL; @@ -414,7 +420,7 @@ static int brush_select_exec(bContext *C, wmOperator *op) Object *ob = CTX_data_active_object(C); if (ob) { /* select current paint mode */ - paint_mode = ob->mode & OB_MODE_ALL_PAINT; + paint_mode = eval_ctx.object_mode & OB_MODE_ALL_PAINT; } else { return OPERATOR_CANCELLED; |