From 1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 5 Apr 2018 18:20:27 +0200 Subject: 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. --- source/blender/editors/undo/memfile_undo.c | 54 ------------------------------ 1 file changed, 54 deletions(-) (limited to 'source/blender/editors/undo') diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index 5033d741c7b..b588aa8fb13 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -45,38 +45,13 @@ #include "undo_intern.h" -/** Store workspace modes in undo steps, this may be removed if find a better way to handle. */ -#define USE_WORKSPACE_OBJECT_MODE_HACK - -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK -#include "MEM_guardedalloc.h" -#include "BLI_string.h" -#include "BLI_listbase.h" -#include "BKE_main.h" -#include "DNA_workspace_types.h" -#endif - - /* -------------------------------------------------------------------- */ /** \name Implements ED Undo System * \{ */ -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK -typedef struct WorkSpaceData { - struct WorkSpaceData *next, *prev; - char name[MAX_ID_NAME - 2]; - eObjectMode object_mode, object_mode_restore; - /* TODO, view_layer? */ -} WorkSpaceData; -#endif /* USE_WORKSPACE_OBJECT_MODE_HACK */ - typedef struct MemFileUndoStep { UndoStep step; MemFileUndoData *data; - -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK - ListBase workspace_data; -#endif } MemFileUndoStep; static bool memfile_undosys_poll(bContext *UNUSED(C)) @@ -101,18 +76,6 @@ static bool memfile_undosys_step_encode(struct bContext *C, UndoStep *us_p) us->data = BKE_memfile_undo_encode(bmain, us_prev ? us_prev->data : NULL); us->step.data_size = us->data->undo_size; -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK - { - for (WorkSpace *workspace = bmain->workspaces.first; workspace != NULL; workspace = workspace->id.next) { - WorkSpaceData *wsd = MEM_mallocN(sizeof(*wsd), __func__); - BLI_strncpy(wsd->name, workspace->id.name + 2, sizeof(wsd->name)); - wsd->object_mode = workspace->object_mode; - wsd->object_mode_restore = workspace->object_mode_restore; - BLI_addtail(&us->workspace_data, wsd); - } - } -#endif - return true; } @@ -127,19 +90,6 @@ static void memfile_undosys_step_decode(struct bContext *C, UndoStep *us_p, int BKE_memfile_undo_decode(us->data, C); WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, CTX_data_scene(C)); - -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK - { - struct Main *bmain = CTX_data_main(C); - for (WorkSpaceData *wsd = us->workspace_data.first; wsd != NULL; wsd = wsd->next) { - WorkSpace *workspace = BLI_findstring(&bmain->workspaces, wsd->name, offsetof(ID, name) + 2); - if (workspace) { - workspace->object_mode = wsd->object_mode; - workspace->object_mode_restore = wsd->object_mode_restore; - } - } - } -#endif } static void memfile_undosys_step_free(UndoStep *us_p) @@ -155,10 +105,6 @@ static void memfile_undosys_step_free(UndoStep *us_p) } BKE_memfile_undo_free(us->data); - -#ifdef USE_WORKSPACE_OBJECT_MODE_HACK - BLI_freelistN(&us->workspace_data); -#endif } /* Export for ED_undo_sys. */ -- cgit v1.2.3