diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:20:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-05 19:21:14 +0300 |
commit | 1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 (patch) | |
tree | 7a5af59ce078cb66fb17ec33cf111ffc8d5fb328 /source/blender/editors/mesh/mesh_data.c | |
parent | 57329304b061efe756e3a4ce1b828e9a7c7f7030 (diff) |
Remove workspace object mode, reverts changes w/ 2.8
This caused too many problems syncing object modes
with multiple objects/windows/workspaces, see: D3130 for details.
Diffstat (limited to 'source/blender/editors/mesh/mesh_data.c')
-rw-r--r-- | source/blender/editors/mesh/mesh_data.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index aca67dc84e9..69e265f7315 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -506,14 +506,13 @@ static int layers_poll(bContext *C) static int mesh_uv_texture_add_exec(bContext *C, wmOperator *UNUSED(op)) { - const WorkSpace *workspace = CTX_wm_workspace(C); Object *ob = ED_object_context(C); Mesh *me = ob->data; if (ED_mesh_uv_texture_add(me, NULL, true) == -1) return OPERATOR_CANCELLED; - if (workspace->object_mode & OB_MODE_TEXTURE_PAINT) { + if (ob->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); @@ -623,14 +622,13 @@ void MESH_OT_drop_named_image(wmOperatorType *ot) static int mesh_uv_texture_remove_exec(bContext *C, wmOperator *UNUSED(op)) { - const WorkSpace *workspace = CTX_wm_workspace(C); Object *ob = ED_object_context(C); Mesh *me = ob->data; if (!ED_mesh_uv_texture_remove_active(me)) return OPERATOR_CANCELLED; - if (workspace->object_mode & OB_MODE_TEXTURE_PAINT) { + if (ob->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); @@ -744,14 +742,13 @@ static int mesh_customdata_mask_clear_poll(bContext *C) { Object *ob = ED_object_context(C); if (ob && ob->type == OB_MESH) { - const WorkSpace *workspace = CTX_wm_workspace(C); + Mesh *me = ob->data; /* special case - can't run this if we're in sculpt mode */ - if (workspace->object_mode & OB_MODE_SCULPT) { + if (ob->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)) { |