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-04-05 19:20:27 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-05 19:21:14 +0300
commit1c24c04e6023f2d2a328dfcdc9f86cd381d029a3 (patch)
tree7a5af59ce078cb66fb17ec33cf111ffc8d5fb328 /source/blender/editors/undo/memfile_undo.c
parent57329304b061efe756e3a4ce1b828e9a7c7f7030 (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/undo/memfile_undo.c')
-rw-r--r--source/blender/editors/undo/memfile_undo.c54
1 files changed, 0 insertions, 54 deletions
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. */