diff options
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index ae8bf8010cc..f9f87731197 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -3245,6 +3245,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER); BLI_insertlinkbefore(regionbase, ar_header, ar); + /* Hide by default, enable for painting workspaces (startup only). */ + ar->flag |= RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER; } if (ar != NULL) { SET_FLAG_FROM_TEST(ar->flag, ar->flag & RGN_FLAG_HIDDEN_BY_USER, RGN_FLAG_HIDDEN); diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index b5b86224644..7674c7cadcd 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -293,6 +293,34 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) } } + /* Show toopbar for sculpt/paint modes. */ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + bool show_tool_header = false; + if (app_template == NULL) { + if (STR_ELEM(screen->id.name + 2, "Sculpting", "Texture Paint")) { + show_tool_header = true; + } + } + else if (STREQ(app_template, "2D_Animation")) { + if (STR_ELEM(screen->id.name + 2, "Sculpting", "Texture Paint")) { + show_tool_header = true; + } + } + + if (show_tool_header) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + for (ARegion *ar = regionbase->first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_TOOL_HEADER) { + ar->flag &= ~(RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER); + } + } + } + } + } + } + for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); |