diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-27 04:20:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-27 04:20:27 +0300 |
commit | ed83075402c2b6df757857ead0c93bb8bf14093d (patch) | |
tree | bfb38e533d018a02bc345a58c4db6e3a041a1191 /source/blender/blenloader | |
parent | 6ebe21164468fe231749bea29d5152493ea61d42 (diff) |
Tool System: set a default tool for each mode
Also clear tools for the default startup file
so changes to defaults apply to new files.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index 8972e7ef56f..a741d0ecc1f 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -45,6 +45,7 @@ #include "BKE_main.h" #include "BKE_node.h" #include "BKE_screen.h" +#include "BKE_workspace.h" #include "BLO_readfile.h" @@ -94,6 +95,15 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } + if (app_template == NULL) { + /* Clear all tools to use default options instead, ignore the tool saved in the file. */ + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { + while (!BLI_listbase_is_empty(&workspace->tools)) { + BKE_workspace_tool_remove(workspace, workspace->tools.first); + } + } + } + /* For 2D animation template. */ if (app_template && STREQ(app_template, "2D_Animation")) { for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { |