Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-02-06 09:06:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-06 10:03:28 +0300
commitc7fecab2efd3b28a18b56dbd321616728d8b7cce (patch)
tree0169ab63925ce3d6730f519a4a54822e7f77c652 /source/blender/editors/sculpt_paint/paint_image.c
parentef11113399e3273ee647b3710b346356a2b5f8f0 (diff)
Object Mode: Use eval_ctx mode for drawing, paint & modifiers
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c41
1 files changed, 29 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index aebd0c10e9c..1ae13fcaec0 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -588,13 +588,15 @@ static Brush *image_paint_brush(bContext *C)
static int image_paint_poll(bContext *C)
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
Object *obact;
- if (!image_paint_brush(C))
+ if (!image_paint_brush(C)) {
return 0;
-
+ }
obact = CTX_data_active_object(C);
- if ((obact && obact->mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
+ if ((obact && eval_ctx.object_mode & OB_MODE_TEXTURE_PAINT) && CTX_wm_region_view3d(C)) {
return 1;
}
else {
@@ -1469,11 +1471,13 @@ void PAINT_OT_texture_paint_toggle(wmOperatorType *ot)
static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
UnifiedPaintSettings *ups = &CTX_data_tool_settings(C)->unified_paint_settings;
Brush *br;
Object *ob = CTX_data_active_object(C);
- if (!(ob && (ob->mode & OB_MODE_VERTEX_PAINT))) {
+ if (!(ob && (eval_ctx.object_mode & OB_MODE_VERTEX_PAINT))) {
br = image_paint_brush(C);
}
else {
@@ -1504,8 +1508,12 @@ static int brush_colors_flip_poll(bContext *C)
}
else {
Object *ob = CTX_data_active_object(C);
- if (ob && (ob->mode & OB_MODE_VERTEX_PAINT)) {
- return 1;
+ if (ob) {
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+ if (eval_ctx.object_mode & OB_MODE_VERTEX_PAINT) {
+ return 1;
+ }
}
}
return 0;
@@ -1545,10 +1553,13 @@ void ED_imapaint_bucket_fill(struct bContext *C, float color[3], wmOperator *op)
static int texture_paint_poll(bContext *C)
{
- if (texture_paint_toggle_poll(C))
- if (CTX_data_active_object(C)->mode & OB_MODE_TEXTURE_PAINT)
+ if (texture_paint_toggle_poll(C)) {
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+ if (eval_ctx.object_mode & OB_MODE_TEXTURE_PAINT) {
return 1;
-
+ }
+ }
return 0;
}
@@ -1559,16 +1570,22 @@ int image_texture_paint_poll(bContext *C)
int facemask_paint_poll(bContext *C)
{
- return BKE_paint_select_face_test(CTX_data_active_object(C));
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+ return BKE_paint_select_face_test(&eval_ctx, CTX_data_active_object(C));
}
int vert_paint_poll(bContext *C)
{
- return BKE_paint_select_vert_test(CTX_data_active_object(C));
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+ return BKE_paint_select_vert_test(&eval_ctx, CTX_data_active_object(C));
}
int mask_paint_poll(bContext *C)
{
- return BKE_paint_select_elem_test(CTX_data_active_object(C));
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+ return BKE_paint_select_elem_test(&eval_ctx, CTX_data_active_object(C));
}