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/render | |
parent | 906ed54d286d0dd6686aac997883e7dfa4bba792 (diff) |
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 270ba2a7947..6d6f5185af7 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -99,6 +99,8 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Object *ob = ED_object_context(C); if (!ob) @@ -106,7 +108,7 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) BKE_object_material_slot_add(ob); - if (ob->mode & OB_MODE_TEXTURE_PAINT) { + if (eval_ctx.object_mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); @@ -136,6 +138,8 @@ void OBJECT_OT_material_slot_add(wmOperatorType *ot) static int material_slot_remove_exec(bContext *C, wmOperator *op) { + EvaluationContext eval_ctx; + CTX_data_eval_ctx(C, &eval_ctx); Object *ob = ED_object_context(C); if (!ob) @@ -149,7 +153,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op) BKE_object_material_slot_remove(ob); - if (ob->mode & OB_MODE_TEXTURE_PAINT) { + if (eval_ctx.object_mode & OB_MODE_TEXTURE_PAINT) { Scene *scene = CTX_data_scene(C); BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); WM_event_add_notifier(C, NC_SCENE | ND_TOOLSETTINGS, NULL); |