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:53:19 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-06 10:03:29 +0300
commit2a184f3d2b6cc180fedd0c93c266d847f7d27936 (patch)
tree5d7472cb10888e6e18dd64bbcdb3c078ac325ca0 /source/blender/editors/mesh/mesh_data.c
parent906ed54d286d0dd6686aac997883e7dfa4bba792 (diff)
Object Mode: use eval_ctx for paint & object
Diffstat (limited to 'source/blender/editors/mesh/mesh_data.c')
-rw-r--r--source/blender/editors/mesh/mesh_data.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 218b97d3ede..efaf9a69e9c 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -506,13 +506,16 @@ static int layers_poll(bContext *C)
static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op))
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+
Object *ob = ED_object_context(C);
Mesh *me = ob->data;
if (ED_mesh_uv_texture_add(me, NULL, true) == -1)
return OPERATOR_CANCELLED;
- 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);
@@ -622,13 +625,16 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+
Object *ob = ED_object_context(C);
Mesh *me = ob->data;
if (!ED_mesh_uv_texture_remove_active(me))
return OPERATOR_CANCELLED;
- 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);
@@ -742,13 +748,16 @@ static int mesh_customdata_mask_clear_poll(bContext *C)
{
Object *ob = ED_object_context(C);
if (ob && ob->type == OB_MESH) {
- Mesh *me = ob->data;
+ EvaluationContext eval_ctx;
+ CTX_data_eval_ctx(C, &eval_ctx);
+
/* special case - can't run this if we're in sculpt mode */
- if (ob->mode & OB_MODE_SCULPT) {
+ if (eval_ctx.object_mode & OB_MODE_SCULPT) {
return false;
}
+ Mesh *me = ob->data;
if (!ID_IS_LINKED(me)) {
CustomData *data = GET_CD_DATA(me, vdata);
if (CustomData_has_layer(data, CD_PAINT_MASK)) {