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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-28 05:57:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-28 05:58:53 +0300
commitb58d4e7fe4a01250f13d4bb764806e9f8d59db1b (patch)
treebc3c953681fd5692294533230af422a9650adace /source
parentba8c21989c9b75bc8ec3bcacc381b2787fb07704 (diff)
WM: remove tool initialization code
Area initialization handles these cases now.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/workspace_edit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_toolsystem.c32
-rw-r--r--source/creator/creator.c5
3 files changed, 2 insertions, 37 deletions
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index 6c836c9fc08..d8e0945eb25 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -187,7 +187,7 @@ bool ED_workspace_change(
BLI_assert(CTX_wm_workspace(C) == workspace_new);
WM_toolsystem_unlink_all(C, workspace_old);
- WM_toolsystem_reinit_all(C, win);
+ /* Area initialization will initialize based on the new workspace. */
/* Automatic mode switching. */
if (workspace_new->object_mode != workspace_old->object_mode) {
diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c
index 2b2a4f5e43a..3b91b351b25 100644
--- a/source/blender/windowmanager/intern/wm_toolsystem.c
+++ b/source/blender/windowmanager/intern/wm_toolsystem.c
@@ -553,40 +553,10 @@ void WM_toolsystem_init(bContext *C)
LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) {
LISTBASE_FOREACH (bToolRef *, tref, &workspace->tools) {
MEM_SAFE_FREE(tref->runtime);
- tref->tag = 0;
}
}
- for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
- for (wmWindow *win = wm->windows.first; win; win = win->next) {
- CTX_wm_window_set(C, win);
- WorkSpace *workspace = WM_window_get_active_workspace(win);
- bScreen *screen = WM_window_get_active_screen(win);
- ViewLayer *view_layer = WM_window_get_active_view_layer(win);
- for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
- if (((1 << sa->spacetype) & WM_TOOLSYSTEM_SPACE_MASK) == 0) {
- continue;
- }
- const bToolKey tkey = {
- .space_type = sa->spacetype,
- .mode = WM_toolsystem_mode_from_spacetype(view_layer, sa, sa->spacetype),
- };
- bToolRef *tref = WM_toolsystem_ref_find(workspace, &tkey);
- if (tref) {
- if (tref->tag == 0) {
- toolsystem_reinit_ref(C, workspace, tref);
- tref->tag = 1;
- }
- }
- else {
- /* Without this we may load a file without a default tool. */
- tref = toolsystem_reinit_ensure_toolref(C, workspace, &tkey, NULL);
- tref->tag = 1;
- }
- }
- CTX_wm_window_set(C, NULL);
- }
- }
+ /* Rely on screen initialization for gizmos. */
}
int WM_toolsystem_mode_from_spacetype(
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 5bc266427d5..5a61f077a84 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -467,11 +467,6 @@ int main(
CTX_py_init_set(C, 1);
WM_keyconfig_init(C);
- /* Called on load, however Python is not yet initialized, so call again here. */
- if (!G.background) {
- WM_toolsystem_init(C);
- }
-
#ifdef WITH_FREESTYLE
/* initialize Freestyle */
FRS_initialize();