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.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user