Merge branch 'blender2.8' into userpref_redesign
authorJulian Eisel <eiseljulian@gmail.com>
Thu, 22 Nov 2018 18:06:52 +0000 (19:06 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Thu, 22 Nov 2018 18:06:52 +0000 (19:06 +0100)
17 files changed:
1  2 
release/scripts/addons
release/scripts/addons_contrib
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_topbar.py
release/scripts/startup/bl_ui/space_userpref.py
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/intern/screen.c
source/blender/blenloader/intern/versioning_280.c
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_userpref/space_userpref.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/intern/rna_userdef.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_window.c
source/tools

index c88411ff7776a2db5d6ef6117a1b2faa42a95611,ad39a4b8961e2afb852852e2e3057bc3a770d2ee..6f0128c332290c6f3639d4d949d3e06bfaa71022
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit c88411ff7776a2db5d6ef6117a1b2faa42a95611
 -Subproject commit ad39a4b8961e2afb852852e2e3057bc3a770d2ee
++Subproject commit 6f0128c332290c6f3639d4d949d3e06bfaa71022
index 310578043dec1aae382eb6a447ae1d103792d7e6,ee92205e9687eabb0ef91d8c437014ac720126ea..5c4210d5b78c61137c5f32e7deb7561177ac0894
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 310578043dec1aae382eb6a447ae1d103792d7e6
 -Subproject commit ee92205e9687eabb0ef91d8c437014ac720126ea
++Subproject commit 5c4210d5b78c61137c5f32e7deb7561177ac0894
index 5424a7050c70f4b2b2bd2c45676377d7fbca8682,49c55410f53c49718bd0ca5dfb8bbdb32483b007..b98c65e0f95b07bd5a0849fc23865938ced0bf75
@@@ -26,182 -26,15 +26,17 @@@ class INFO_HT_header(Header)
  
      def draw(self, context):
          layout = self.layout
+         layout.template_header()
  
-         window = context.window
-         workspace = context.workspace
-         screen = context.screen
-         scene = context.scene
-         layer = context.view_layer
-         view_render = workspace.view_render
+         # Empty for now until info editor gets turned into log editor
+         pass
  
 +        row = layout.row(align=True)
 +        row.template_header()
  
-         INFO_MT_editor_menus.draw_collapsible(context, layout)
-         layout.separator()
-         if screen.show_fullscreen:
-             layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
-             layout.separator()
-         else:
-             layout.template_ID(window, "workspace", new="workspace.workspace_add_menu", unlink="workspace.workspace_delete")
-             layout.template_search_preview(window, "screen", workspace, "screens", new="screen.new", unlink="screen.delete", rows=2, cols=6)
-         act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[layer.objects.active.mode]
-         layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon)
-         row = layout.row()
-         row.active = not workspace.use_scene_settings
-         # Active workspace view-layer is retrieved through window, not through workspace.
-         row.template_search(window, "view_layer", scene, "view_layers")
-         if view_render.has_multiple_engines:
-             row.prop(view_render, "engine", text="")
-         layout.separator()
-         layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete")
-         layout.separator()
-         layout.template_running_jobs()
-         layout.template_reports_banner()
-         row = layout.row(align=True)
-         if bpy.app.autoexec_fail is True and bpy.app.autoexec_fail_quiet is False:
-             row.label("Auto-run disabled", icon='ERROR')
-             if bpy.data.is_saved:
-                 props = row.operator("wm.revert_mainfile", icon='SCREEN_BACK', text="Reload Trusted")
-                 props.use_scripts = True
-             row.operator("script.autoexec_warn_clear", text="Ignore")
-             # include last so text doesn't push buttons out of the header
-             row.label(bpy.app.autoexec_fail_message)
-             return
-         row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
-         row.label(text=scene.statistics(context.view_layer), translate=False)
- class INFO_MT_editor_menus(Menu):
-     bl_idname = "INFO_MT_editor_menus"
-     bl_label = ""
-     def draw(self, context):
-         self.draw_menus(self.layout, context)
-     @staticmethod
-     def draw_menus(layout, context):
-         view_render = context.view_render
-         layout.menu("INFO_MT_file")
-         if view_render.use_game_engine:
-             layout.menu("INFO_MT_game")
-         else:
-             layout.menu("INFO_MT_render")
-         layout.menu("INFO_MT_window")
-         layout.menu("INFO_MT_help")
- class INFO_MT_file(Menu):
-     bl_label = "File"
-     def draw(self, context):
-         layout = self.layout
-         layout.operator_context = 'INVOKE_AREA'
-         layout.operator("wm.read_homefile", text="New", icon='NEW')
-         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
-         layout.menu("INFO_MT_file_open_recent", icon='OPEN_RECENT')
-         layout.operator("wm.revert_mainfile", icon='FILE_REFRESH')
-         layout.operator("wm.recover_last_session", icon='RECOVER_LAST')
-         layout.operator("wm.recover_auto_save", text="Recover Auto Save...", icon='RECOVER_AUTO')
-         layout.separator()
-         layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
-         layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
-         layout.operator_context = 'INVOKE_AREA'
-         layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS')
-         layout.operator_context = 'INVOKE_AREA'
-         layout.operator("wm.save_as_mainfile", text="Save Copy...", icon='SAVE_COPY').copy = True
-         layout.separator()
-         layout.operator("screen.settings_show", text="Settings...", icon='PREFERENCES')
-         layout.operator_context = 'INVOKE_AREA'
-         layout.operator("wm.save_homefile", icon='SAVE_PREFS')
-         layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY')
-         if any(bpy.utils.app_template_paths()):
-             app_template = context.user_preferences.app_template
-             if app_template:
-                 layout.operator(
-                     "wm.read_factory_settings",
-                     text="Load Factory Template Settings",
-                     icon='LOAD_FACTORY',
-                 ).app_template = app_template
-             del app_template
-         layout.menu("USERPREF_MT_app_templates", icon='FILE_BLEND')
-         layout.separator()
-         layout.operator_context = 'INVOKE_AREA'
-         layout.operator("wm.link", text="Link", icon='LINK_BLEND')
-         layout.operator("wm.append", text="Append", icon='APPEND_BLEND')
-         layout.menu("INFO_MT_file_previews")
-         layout.separator()
-         layout.menu("INFO_MT_file_import", icon='IMPORT')
-         layout.menu("INFO_MT_file_export", icon='EXPORT')
-         layout.separator()
-         layout.menu("INFO_MT_file_external_data", icon='EXTERNAL_DATA')
-         layout.operator("wm.blend_strings_utf8_validate", icon='FILE_BLEND')
-         layout.separator()
-         layout.operator_context = 'EXEC_AREA'
-         if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog:
-             layout.operator_context = 'INVOKE_SCREEN'  # quit dialog
-         layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
- class INFO_MT_file_import(Menu):
-     bl_idname = "INFO_MT_file_import"
-     bl_label = "Import"
-     def draw(self, context):
-         if bpy.app.build_options.collada:
-             self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
-         if bpy.app.build_options.alembic:
-             self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
- class INFO_MT_file_export(Menu):
-     bl_idname = "INFO_MT_file_export"
-     bl_label = "Export"
-     def draw(self, context):
-         if bpy.app.build_options.collada:
-             self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
-         if bpy.app.build_options.alembic:
-             self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
- class INFO_MT_file_external_data(Menu):
-     bl_label = "External Data"
+ # Not really info, just add to re-usable location.
+ class INFO_MT_area(Menu):
+     bl_label = "Area"
  
      def draw(self, context):
          layout = self.layout
index 0000000000000000000000000000000000000000,8b9c47839e99496956cb4ba0bfa5eedb389be118..b0b63fd7c7d87a52fd0e0c1466690f8956221f86
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,1049 +1,1049 @@@
 -        layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
+ # ##### BEGIN GPL LICENSE BLOCK #####
+ #
+ #  This program is free software; you can redistribute it and/or
+ #  modify it under the terms of the GNU General Public License
+ #  as published by the Free Software Foundation; either version 2
+ #  of the License, or (at your option) any later version.
+ #
+ #  This program is distributed in the hope that it will be useful,
+ #  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ #  GNU General Public License for more details.
+ #
+ #  You should have received a copy of the GNU General Public License
+ #  along with this program; if not, write to the Free Software Foundation,
+ #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #
+ # ##### END GPL LICENSE BLOCK #####
+ # <pep8 compliant>
+ import bpy
+ from bpy.types import Header, Menu, Panel
+ from .properties_grease_pencil_common import (
+     GPENCIL_UL_layer,
+ )
+ class TOPBAR_HT_upper_bar(Header):
+     bl_space_type = 'TOPBAR'
+     def draw(self, context):
+         region = context.region
+         if region.alignment == 'RIGHT':
+             self.draw_right(context)
+         else:
+             self.draw_left(context)
+     def draw_left(self, context):
+         layout = self.layout
+         window = context.window
+         screen = context.screen
+         layout.operator("wm.splash", text="", icon='BLENDER', emboss=False)
+         TOPBAR_MT_editor_menus.draw_collapsible(context, layout)
+         layout.separator()
+         if not screen.show_fullscreen:
+             layout.template_ID_tabs(
+                 window, "workspace",
+                 new="workspace.add",
+                 menu="TOPBAR_MT_workspace_menu",
+             )
+         else:
+             layout.operator(
+                 "screen.back_to_previous",
+                 icon='SCREEN_BACK',
+                 text="Back to Previous",
+             )
+     def draw_right(self, context):
+         layout = self.layout
+         window = context.window
+         screen = context.screen
+         scene = window.scene
+         # If statusbar is hidden, still show messages at the top
+         if not screen.show_statusbar:
+             layout.template_reports_banner()
+             layout.template_running_jobs()
+         # Active workspace view-layer is retrieved through window, not through workspace.
+         layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete")
+         row = layout.row(align=True)
+         row.template_search(
+             window, "view_layer",
+             scene, "view_layers",
+             new="scene.view_layer_add",
+             unlink="scene.view_layer_remove")
+ class TOPBAR_HT_lower_bar(Header):
+     bl_space_type = 'TOPBAR'
+     bl_region_type = 'WINDOW'
+     def draw(self, context):
+         region = context.region
+         if region.alignment == 'LEFT':
+             self.draw_left(context)
+         elif region.alignment == 'RIGHT':
+             self.draw_right(context)
+         else:
+             self.draw_center(context)
+     def draw_left(self, context):
+         layout = self.layout
+         # Active Tool
+         # -----------
+         from .space_toolsystem_common import ToolSelectPanelHelper
+         tool = ToolSelectPanelHelper.draw_active_tool_header(context, layout)
+         tool_space_type = 'VIEW_3D' if tool is None else tool.space_type
+         tool_mode = context.mode if tool is None else tool.mode
+         # Object Mode Options
+         # -------------------
+         # Example of how toolsettings can be accessed as pop-overs.
+         # TODO(campbell): editing options should be after active tool options
+         # (obviously separated for from the users POV)
+         draw_fn = getattr(getattr(_draw_left_context_mode, tool_space_type, None), tool_mode, None)
+         if draw_fn is not None:
+             draw_fn(context, layout, tool)
+         if tool_space_type == 'VIEW_3D':
+             # Note: general mode options should be added to 'draw_right'.
+             if tool_mode == 'SCULPT':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
+             elif tool_mode == 'PAINT_VERTEX':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
+             elif tool_mode == 'PAINT_WEIGHT':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
+             elif tool_mode == 'PAINT_TEXTURE':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
+             elif tool_mode == 'EDIT_ARMATURE':
+                 pass
+             elif tool_mode == 'EDIT_CURVE':
+                 pass
+             elif tool_mode == 'EDIT_MESH':
+                 pass
+             elif tool_mode == 'POSE':
+                 pass
+             elif tool_mode == 'PARTICLE':
+                 # Disable, only shows "Brush" panel, which is already in the top-bar.
+                 # if tool.has_datablock:
+                 #     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="")
+                 pass
+             elif tool_mode == 'GPENCIL_PAINT':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_paint", category="")
+             elif tool_mode == 'GPENCIL_SCULPT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_sculpt", category="")
+             elif tool_mode == 'GPENCIL_WEIGHT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".greasepencil_weight", category="")
+         elif tool_space_type == 'IMAGE_EDITOR':
+             if tool_mode == 'PAINT':
+                 if (tool is not None) and tool.has_datablock:
+                     layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common_2d", category="")
+             elif context.uv_sculpt_object is not None:
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".uv_sculpt", category="")
+     def draw_center(self, context):
+         pass
+     def draw_right(self, context):
+         layout = self.layout
+         # Active Tool
+         # -----------
+         from .space_toolsystem_common import ToolSelectPanelHelper
+         tool = ToolSelectPanelHelper.tool_active_from_context(context)
+         tool_space_type = 'VIEW_3D' if tool is None else tool.space_type
+         tool_mode = context.mode if tool is None else tool.mode
+         if tool_space_type == 'VIEW_3D':
+             if tool_mode == 'SCULPT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".sculpt_mode", category="")
+             elif tool_mode == 'PAINT_VERTEX':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".vertexpaint", category="")
+             elif tool_mode == 'PAINT_WEIGHT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".weightpaint", category="")
+             elif tool_mode == 'PAINT_TEXTURE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".imagepaint", category="")
+             elif tool_mode == 'EDIT_TEXT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".text_edit", category="")
+             elif tool_mode == 'EDIT_ARMATURE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".armature_edit", category="")
+             elif tool_mode == 'EDIT_METABALL':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".mball_edit", category="")
+             elif tool_mode == 'EDIT_LATTICE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".lattice_edit", category="")
+             elif tool_mode == 'EDIT_CURVE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".curve_edit", category="")
+             elif tool_mode == 'EDIT_MESH':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".mesh_edit", category="")
+             elif tool_mode == 'POSE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".posemode", category="")
+             elif tool_mode == 'PARTICLE':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="")
+             elif tool_mode == 'OBJECT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".objectmode", category="")
+             elif tool_mode in {'GPENCIL_PAINT', 'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
+                 # Grease pencil layer.
+                 gpl = context.active_gpencil_layer
+                 if gpl and gpl.info is not None:
+                     text = gpl.info
+                     maxw = 25
+                     if len(text) > maxw:
+                         text = text[:maxw - 5] + '..' + text[-3:]
+                 else:
+                     text = ""
+                 layout.label(text="Layer:")
+                 sub = layout.row()
+                 sub.ui_units_x = 8
+                 sub.popover(
+                     panel="TOPBAR_PT_gpencil_layers",
+                     text=text,
+                 )
+         elif tool_space_type == 'IMAGE_EDITOR':
+             if tool_mode == 'PAINT':
+                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".imagepaint_2d", category="")
+ class _draw_left_context_mode:
+     class VIEW_3D:
+         @staticmethod
+         def SCULPT(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.sculpt
+             layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+             brush = paint.brush
+             if brush is None:
+                 return
+             from .properties_paint_common import UnifiedPaintPanel
+             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
+             UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
+             layout.prop(brush, "direction", text="", expand=True)
+         @staticmethod
+         def PAINT_TEXTURE(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.image_paint
+             layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+             brush = paint.brush
+             if brush is None:
+                 return
+             from .properties_paint_common import UnifiedPaintPanel
+             UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
+             UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
+         @staticmethod
+         def PAINT_VERTEX(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.vertex_paint
+             layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+             brush = paint.brush
+             if brush is None:
+                 return
+             from .properties_paint_common import UnifiedPaintPanel
+             UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
+             UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
+         @staticmethod
+         def PAINT_WEIGHT(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.weight_paint
+             layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+             brush = paint.brush
+             if brush is None:
+                 return
+             from .properties_paint_common import UnifiedPaintPanel
+             UnifiedPaintPanel.prop_unified_weight(layout, context, brush, "weight", slider=True, text="Weight")
+             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
+             UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
+         @staticmethod
+         def GPENCIL_PAINT(context, layout, tool):
+             if tool is None:
+                 return
+             is_paint = True
+             if (tool.name in {"Line", "Box", "Circle"}):
+                 is_paint = False
+             elif (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.gpencil_paint
+             brush = paint.brush
+             if brush is None:
+                 return
+             gp_settings = brush.gpencil_settings
+             def draw_color_selector():
+                 ma = gp_settings.material
+                 row = layout.row(align=True)
+                 icon_id = 0
+                 if ma:
+                     icon_id = ma.id_data.preview.icon_id
+                     txt_ma = ma.name
+                     maxw = 25
+                     if len(txt_ma) > maxw:
+                         txt_ma = txt_ma[:maxw - 5] + '..' + txt_ma[-3:]
+                 else:
+                     txt_ma = ""
+                 row.label(text="Material:")
+                 sub = row.row()
+                 sub.ui_units_x = 8
+                 sub.popover(
+                     panel="TOPBAR_PT_gpencil_materials",
+                     text=txt_ma,
+                     icon_value=icon_id,
+                 )
+                 row.prop(gp_settings, "use_material_pin", text="")
+             row = layout.row(align=True)
+             ts = context.scene.tool_settings
+             settings = ts.gpencil_paint
+             row.template_ID_preview(settings, "brush", rows=3, cols=8, hide_buttons=True)
+             if brush.gpencil_tool == 'ERASE':
+                 row = layout.row(align=True)
+                 row.prop(brush, "size", text="Radius")
+                 row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+                 if gp_settings.eraser_mode == 'SOFT':
+                     row = layout.row(align=True)
+                     row.prop(gp_settings, "pen_strength", slider=True)
+                     row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+             elif brush.gpencil_tool == 'FILL':
+                 row = layout.row()
+                 row.prop(gp_settings, "fill_leak", text="Leak Size")
+                 row.prop(brush, "size", text="Thickness")
+                 row.prop(gp_settings, "fill_simplify_level", text="Simplify")
+                 draw_color_selector()
+                 row = layout.row(align=True)
+                 row.prop(gp_settings, "fill_draw_mode", text="")
+                 row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
+             else:  # brush.gpencil_tool == 'DRAW':
+                 row = layout.row(align=True)
+                 row.prop(brush, "size", text="Radius")
+                 if is_paint:
+                     row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+                 row = layout.row(align=True)
+                 row.prop(gp_settings, "pen_strength", slider=True)
+                 if is_paint:
+                     row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
+                 draw_color_selector()
+         @staticmethod
+         def GPENCIL_SCULPT(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             tool_settings = context.tool_settings
+             settings = tool_settings.gpencil_sculpt
+             tool = settings.sculpt_tool
+             brush = settings.brush
+             layout.prop(brush, "size", slider=True)
+             row = layout.row(align=True)
+             row.prop(brush, "strength", slider=True)
+             row.prop(brush, "use_pressure_strength", text="")
+             if tool in {'THICKNESS', 'STRENGTH', 'PINCH', 'TWIST'}:
+                 row.separator()
+                 row.prop(brush, "direction", expand=True, text="")
+         @staticmethod
+         def GPENCIL_WEIGHT(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             tool_settings = context.tool_settings
+             settings = tool_settings.gpencil_sculpt
+             brush = settings.brush
+             layout.prop(brush, "size", slider=True)
+             row = layout.row(align=True)
+             row.prop(brush, "strength", slider=True)
+             row.prop(brush, "use_pressure_strength", text="")
+             layout.prop(brush, "target_weight", slider=True)
+         @staticmethod
+         def PARTICLE(context, layout, tool):
+             # See: 'VIEW3D_PT_tools_brush', basically a duplicate
+             settings = context.tool_settings.particle_edit
+             brush = settings.brush
+             tool = settings.tool
+             if tool != 'NONE':
+                 layout.prop(brush, "size", slider=True)
+                 if tool == 'ADD':
+                     layout.prop(brush, "count")
+                     layout.prop(settings, "use_default_interpolate")
+                     layout.prop(brush, "steps", slider=True)
+                     layout.prop(settings, "default_key_count", slider=True)
+                 else:
+                     layout.prop(brush, "strength", slider=True)
+                     if tool == 'LENGTH':
+                         layout.row().prop(brush, "length_mode", expand=True)
+                     elif tool == 'PUFF':
+                         layout.row().prop(brush, "puff_mode", expand=True)
+                         layout.prop(brush, "use_puff_volume")
+                     elif tool == 'COMB':
+                         # Note: actually in 'Options' panel,
+                         # disabled when used in popover.
+                         row = layout.row()
+                         row.active = settings.is_editable
+                         row.prop(settings, "use_emitter_deflect", text="Deflect Emitter")
+                         sub = row.row(align=True)
+                         sub.active = settings.use_emitter_deflect
+                         sub.prop(settings, "emitter_distance", text="Distance")
+     class IMAGE_EDITOR:
+         @staticmethod
+         def VIEW(context, layout, tool):
+             tool_settings = context.tool_settings
+             if tool_settings.use_uv_sculpt:
+                 if context.mode == 'EDIT_MESH':
+                     uv_sculpt = tool_settings.uv_sculpt
+                     brush = uv_sculpt.brush
+                     if brush:
+                         from .properties_paint_common import UnifiedPaintPanel
+                         row = layout.row(align=True)
+                         UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
+                         UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
+                         row = layout.row(align=True)
+                         UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength")
+                         UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
+         @staticmethod
+         def PAINT(context, layout, tool):
+             if (tool is None) or (not tool.has_datablock):
+                 return
+             paint = context.tool_settings.image_paint
+             layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True)
+             brush = paint.brush
+             if brush is None:
+                 return
+             from .properties_paint_common import UnifiedPaintPanel
+             UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+             UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius")
+             UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength")
+ class TOPBAR_PT_gpencil_layers(Panel):
+     bl_space_type = 'VIEW_3D'
+     bl_region_type = 'HEADER'
+     bl_label = "Layers"
+     bl_ui_units_x = 14
+     @classmethod
+     def poll(cls, context):
+         if context.gpencil_data is None:
+             return False
+         ob = context.object
+         if ob is not None and ob.type == 'GPENCIL':
+             return True
+         return False
+     @staticmethod
+     def draw(self, context):
+         layout = self.layout
+         gpd = context.gpencil_data
+         # Grease Pencil data...
+         if (gpd is None) or (not gpd.layers):
+             layout.operator("gpencil.layer_add", text="New Layer")
+         else:
+             self.draw_layers(context, layout, gpd)
+     def draw_layers(self, context, layout, gpd):
+         row = layout.row()
+         col = row.column()
+         layer_rows = 10
+         col.template_list("GPENCIL_UL_layer", "", gpd, "layers", gpd.layers, "active_index",
+                           rows=layer_rows, reverse=True)
+         col = row.column()
+         sub = col.column(align=True)
+         sub.operator("gpencil.layer_add", icon='ADD', text="")
+         sub.operator("gpencil.layer_remove", icon='REMOVE', text="")
+         gpl = context.active_gpencil_layer
+         if gpl:
+             sub.menu("GPENCIL_MT_layer_specials", icon='DOWNARROW_HLT', text="")
+             if len(gpd.layers) > 1:
+                 col.separator()
+                 sub = col.column(align=True)
+                 sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP'
+                 sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN'
+                 col.separator()
+                 sub = col.column(align=True)
+                 sub.operator("gpencil.layer_isolate", icon='LOCKED', text="").affect_visibility = False
+                 sub.operator("gpencil.layer_isolate", icon='HIDE_OFF', text="").affect_visibility = True
+         row = layout.row(align=True)
+         if gpl:
+             row.prop(gpl, "opacity", text="Opacity", slider=True)
+ class TOPBAR_MT_editor_menus(Menu):
+     bl_idname = "TOPBAR_MT_editor_menus"
+     bl_label = ""
+     def draw(self, context):
+         self.draw_menus(self.layout, context)
+     @staticmethod
+     def draw_menus(layout, context):
+         layout.menu("TOPBAR_MT_file")
+         layout.menu("TOPBAR_MT_edit")
+         layout.menu("TOPBAR_MT_render")
+         layout.menu("TOPBAR_MT_window")
+         layout.menu("TOPBAR_MT_help")
+ class TOPBAR_MT_file(Menu):
+     bl_label = "File"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator_context = 'INVOKE_AREA'
+         layout.menu("TOPBAR_MT_file_new", text="New", icon='FILE_NEW')
+         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
+         layout.menu("TOPBAR_MT_file_open_recent")
+         layout.operator("wm.revert_mainfile")
+         layout.operator("wm.recover_last_session")
+         layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
+         layout.separator()
+         layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
+         layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
+         layout.operator_context = 'INVOKE_AREA'
+         layout.operator("wm.save_as_mainfile", text="Save As...")
+         layout.operator_context = 'INVOKE_AREA'
+         layout.operator("wm.save_as_mainfile", text="Save Copy...").copy = True
+         layout.separator()
+         layout.operator_context = 'INVOKE_AREA'
+         if any(bpy.utils.app_template_paths()):
+             app_template = context.user_preferences.app_template
+         else:
+             app_template = None
+         if app_template:
+             layout.label(text=bpy.path.display_name(app_template))
+             layout.operator("wm.save_homefile")
+             layout.operator(
+                 "wm.read_factory_settings",
+                 text="Load Factory Settings",
+             ).app_template = app_template
+         else:
+             layout.operator("wm.save_homefile")
+             layout.operator("wm.read_factory_settings")
+         layout.separator()
+         layout.operator("wm.app_template_install", text="Install Application Template...")
+         layout.separator()
+         layout.operator_context = 'INVOKE_AREA'
+         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
+         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
+         layout.menu("TOPBAR_MT_file_previews")
+         layout.separator()
+         layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
+         layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
+         layout.separator()
+         layout.menu("TOPBAR_MT_file_external_data")
+         layout.separator()
+         layout.operator_context = 'EXEC_AREA'
+         if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog:
+             layout.operator_context = 'INVOKE_SCREEN'  # quit dialog
+         layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
+ class TOPBAR_MT_file_new(Menu):
+     bl_label = "New File"
+     @staticmethod
+     def app_template_paths():
+         import os
+         template_paths = bpy.utils.app_template_paths()
+         # expand template paths
+         app_templates = []
+         for path in template_paths:
+             for d in os.listdir(path):
+                 if d.startswith(("__", ".")):
+                     continue
+                 template = os.path.join(path, d)
+                 if os.path.isdir(template):
+                     # template_paths_expand.append(template)
+                     app_templates.append(d)
+         return sorted(app_templates)
+     def draw_ex(layout, context, *, use_splash=False, use_more=False):
+         layout.operator_context = 'EXEC_DEFAULT'
+         # Limit number of templates in splash screen, spill over into more menu.
+         paths = TOPBAR_MT_file_new.app_template_paths()
+         splash_limit = 5
+         if use_splash:
+             icon = 'FILE_NEW'
+             show_more = len(paths) > (splash_limit - 1)
+             if show_more:
+                 paths = paths[:splash_limit - 2]
+         elif use_more:
+             icon = 'FILE_NEW'
+             paths = paths[splash_limit - 2:]
+             show_more = False
+         else:
+             icon = 'NONE'
+             show_more = False
+         # Draw application templates.
+         if not use_more:
+             props = layout.operator("wm.read_homefile", text="General", icon=icon)
+             props.app_template = ""
+         for d in paths:
+             props = layout.operator(
+                 "wm.read_homefile",
+                 text=bpy.path.display_name(d),
+                 icon=icon,
+             )
+             props.app_template = d
+         if show_more:
+             layout.menu("TOPBAR_MT_templates_more", text="...")
+     def draw(self, context):
+         TOPBAR_MT_file_new.draw_ex(self.layout, context)
+ class TOPBAR_MT_templates_more(Menu):
+     bl_label = "Templates"
+     def draw(self, context):
+         bpy.types.TOPBAR_MT_file_new.draw_ex(self.layout, context, use_more=True)
+ class TOPBAR_MT_file_import(Menu):
+     bl_idname = "TOPBAR_MT_file_import"
+     bl_label = "Import"
+     def draw(self, context):
+         if bpy.app.build_options.collada:
+             self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
+         if bpy.app.build_options.alembic:
+             self.layout.operator("wm.alembic_import", text="Alembic (.abc)")
+ class TOPBAR_MT_file_export(Menu):
+     bl_idname = "TOPBAR_MT_file_export"
+     bl_label = "Export"
+     def draw(self, context):
+         if bpy.app.build_options.collada:
+             self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
+         if bpy.app.build_options.alembic:
+             self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
+ class TOPBAR_MT_file_external_data(Menu):
+     bl_label = "External Data"
+     def draw(self, context):
+         layout = self.layout
+         icon = 'CHECKBOX_HLT' if bpy.data.use_autopack else 'CHECKBOX_DEHLT'
+         layout.operator("file.autopack_toggle", icon=icon)
+         layout.separator()
+         pack_all = layout.row()
+         pack_all.operator("file.pack_all")
+         pack_all.active = not bpy.data.use_autopack
+         unpack_all = layout.row()
+         unpack_all.operator("file.unpack_all")
+         unpack_all.active = not bpy.data.use_autopack
+         layout.separator()
+         layout.operator("file.make_paths_relative")
+         layout.operator("file.make_paths_absolute")
+         layout.operator("file.report_missing_files")
+         layout.operator("file.find_missing_files")
+ class TOPBAR_MT_file_previews(Menu):
+     bl_label = "Data Previews"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator("wm.previews_ensure")
+         layout.operator("wm.previews_batch_generate")
+         layout.separator()
+         layout.operator("wm.previews_clear")
+         layout.operator("wm.previews_batch_clear")
+ class TOPBAR_MT_render(Menu):
+     bl_label = "Render"
+     def draw(self, context):
+         layout = self.layout
+         rd = context.scene.render
+         layout.operator("render.render", text="Render Image", icon='RENDER_STILL').use_viewport = True
+         props = layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION')
+         props.animation = True
+         props.use_viewport = True
+         layout.separator()
+         layout.operator("sound.mixdown", text="Render Audio...")
+         layout.separator()
+         layout.operator("render.view_show", text="View Render")
+         layout.operator("render.play_rendered_anim", text="View Animation")
+         layout.prop_menu_enum(rd, "display_mode", text="Display Mode")
+         layout.separator()
+         layout.prop(rd, "use_lock_interface", text="Lock Interface")
+ class TOPBAR_MT_edit(Menu):
+     bl_label = "Edit"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator("ed.undo")
+         layout.operator("ed.redo")
+         layout.separator()
+         layout.operator("ed.undo_history", text="Undo History...")
+         layout.separator()
+         layout.operator("screen.repeat_last")
+         layout.operator("screen.repeat_history", text="Repeat History...")
+         layout.separator()
+         layout.operator("screen.redo_last", text="Adjust Last Operation...")
+         layout.separator()
+         layout.operator("wm.search_menu", text="Operator Search...", icon='VIEWZOOM')
+         layout.separator()
+         # Should move elsewhere (impacts outliner & 3D view).
+         tool_settings = context.tool_settings
+         layout.prop(tool_settings, "lock_object_mode")
+         layout.separator()
 -        layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
++        layout.operator("screen.settings_show", text="User Preferences...", icon='PREFERENCES')
+ class TOPBAR_MT_window(Menu):
+     bl_label = "Window"
+     def draw(self, context):
+         import sys
+         layout = self.layout
+         layout.operator("wm.window_new")
+         layout.operator("wm.window_new_main")
+         layout.separator()
+         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
+         layout.separator()
+         layout.operator("screen.workspace_cycle", text="Next Workspace").direction = 'NEXT'
+         layout.operator("screen.workspace_cycle", text="Previous Workspace").direction = 'PREV'
+         layout.separator()
+         layout.prop(context.screen, "show_topbar")
+         layout.prop(context.screen, "show_statusbar")
+         layout.separator()
+         layout.operator("screen.screenshot")
+         if sys.platform[:3] == "win":
+             layout.separator()
+             layout.operator("wm.console_toggle", icon='CONSOLE')
+         if context.scene.render.use_multiview:
+             layout.separator()
+             layout.operator("wm.set_stereo_3d")
+ class TOPBAR_MT_help(Menu):
+     bl_label = "Help"
+     def draw(self, context):
+         layout = self.layout
+         show_developer = context.user_preferences.view.show_developer_ui
+         layout.operator(
+             "wm.url_open", text="Manual", icon='HELP',
+         ).url = "https://docs.blender.org/manual/en/dev/"
+         layout.operator(
+             "wm.url_open", text="Report a Bug", icon='URL',
+         ).url = "https://developer.blender.org/maniphest/task/edit/form/1"
+         layout.separator()
+         layout.operator(
+             "wm.url_open", text="User Communities", icon='URL',
+         ).url = "https://www.blender.org/community/"
+         layout.operator(
+             "wm.url_open", text="Developer Community", icon='URL',
+         ).url = "https://www.blender.org/get-involved/developers/"
+         layout.separator()
+         layout.operator(
+             "wm.url_open", text="Blender Website", icon='URL',
+         ).url = "https://www.blender.org"
+         layout.operator(
+             "wm.url_open", text="Release Notes", icon='URL',
+         ).url = "https://www.blender.org/download/releases/%d-%d/" % bpy.app.version[:2]
+         layout.operator(
+             "wm.url_open", text="Credits", icon='URL',
+         ).url = "https://www.blender.org/about/credits/"
+         layout.separator()
+         layout.operator(
+             "wm.url_open", text="Blender Store", icon='URL',
+         ).url = "https://store.blender.org"
+         layout.operator(
+             "wm.url_open", text="Development Fund", icon='URL'
+         ).url = "https://fund.blender.org"
+         layout.operator(
+             "wm.url_open", text="Donate", icon='URL',
+         ).url = "https://www.blender.org/foundation/donation-payment/"
+         layout.separator()
+         if show_developer:
+             layout.operator(
+                 "wm.url_open", text="Python API Reference", icon='URL',
+             ).url = bpy.types.WM_OT_doc_view._prefix
+             layout.operator("wm.operator_cheat_sheet", icon='TEXT')
+         layout.operator("wm.sysinfo")
+         layout.separator()
+         layout.operator("wm.splash", icon='BLENDER')
+ class TOPBAR_MT_file_specials(Menu):
+     bl_label = "File Context Menu"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator_context = 'INVOKE_AREA'
+         layout.operator("wm.read_homefile", text="New", icon='FILE_NEW')
+         layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
+         layout.separator()
+         layout.operator("wm.link", text="Link...", icon='LINK_BLEND')
+         layout.operator("wm.append", text="Append...", icon='APPEND_BLEND')
+         layout.separator()
+         layout.menu("TOPBAR_MT_file_import", icon='IMPORT')
+         layout.menu("TOPBAR_MT_file_export", icon='EXPORT')
+ class TOPBAR_MT_window_specials(Menu):
+     bl_label = "Window Context Menu"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator_context = 'EXEC_AREA'
+         layout.operator("wm.window_new")
+         layout.operator("wm.window_new_main")
+         layout.operator_context = 'INVOKE_AREA'
+         layout.operator("screen.area_dupli", icon='DUPLICATE')
+         layout.separator()
+         layout.operator("screen.area_split", text="Horizontal Split").direction = 'HORIZONTAL'
+         layout.operator("screen.area_split", text="Vertical Split").direction = 'VERTICAL'
+         layout.separator()
+         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
+         layout.separator()
++        layout.operator("screen.settings_show", text="User Preferences...", icon='PREFERENCES')
+ class TOPBAR_MT_workspace_menu(Menu):
+     bl_label = "Workspace"
+     def draw(self, context):
+         layout = self.layout
+         layout.operator("workspace.duplicate", text="Duplicate", icon='DUPLICATE')
+         if len(bpy.data.workspaces) > 1:
+             layout.operator("workspace.delete", text="Delete", icon='REMOVE')
+         layout.separator()
+         layout.operator("workspace.reorder_to_front", text="Reorder to Front", icon='TRIA_LEFT_BAR')
+         layout.operator("workspace.reorder_to_back", text="Reorder to Back", icon='TRIA_RIGHT_BAR')
+ class TOPBAR_PT_active_tool(Panel):
+     bl_space_type = 'PROPERTIES'
+     bl_region_type = 'WINDOW'
+     bl_category = ""
+     bl_context = ".active_tool"  # dot on purpose (access from tool settings)
+     bl_label = "Active Tool"
+     bl_options = {'HIDE_HEADER'}
+     def draw(self, context):
+         layout = self.layout
+         # Panel display of topbar tool settings.
+         # currently displays in tool settings, keep here since the same functionality is used for the topbar.
+         layout.use_property_split = True
+         layout.use_property_decorate = False
+         from .space_toolsystem_common import ToolSelectPanelHelper
+         ToolSelectPanelHelper.draw_active_tool_header(context, layout, show_tool_name=True)
+ classes = (
+     TOPBAR_HT_upper_bar,
+     TOPBAR_HT_lower_bar,
+     TOPBAR_MT_file_specials,
+     TOPBAR_MT_window_specials,
+     TOPBAR_MT_workspace_menu,
+     TOPBAR_MT_editor_menus,
+     TOPBAR_MT_file,
+     TOPBAR_MT_file_new,
+     TOPBAR_MT_templates_more,
+     TOPBAR_MT_file_import,
+     TOPBAR_MT_file_export,
+     TOPBAR_MT_file_external_data,
+     TOPBAR_MT_file_previews,
+     TOPBAR_MT_edit,
+     TOPBAR_MT_render,
+     TOPBAR_MT_window,
+     TOPBAR_MT_help,
+     TOPBAR_PT_active_tool,
+     TOPBAR_PT_gpencil_layers,
+ )
+ if __name__ == "__main__":  # only for live edit.
+     from bpy.utils import register_class
+     for cls in classes:
+         register_class(cls)
index 69382e79758759db7d7a042f8a992fc4fe14df91,954326f88993778243c3eb0c8e11f94507891f80..5e8f1e126c6b85e98cfd72f16d6c044d06591968
@@@ -56,29 -38,31 +38,31 @@@ class USERPREF_HT_header(Header)
  
          userpref = context.user_preferences
  
-         layout.operator_context = 'EXEC_AREA'
-         layout.operator("wm.save_userpref")
-         layout.operator_context = 'INVOKE_DEFAULT'
-         if userpref.active_section == 'INTERFACE':
-             layout.operator("wm.save_workspace_file")
-         elif userpref.active_section == 'INPUT':
-             layout.operator("wm.keyconfig_import")
-             layout.operator("wm.keyconfig_export")
+         if userpref.active_section == 'INPUT':
+             layout.operator("wm.keyconfig_import", icon='IMPORT')
+             layout.operator("wm.keyconfig_export", icon='EXPORT')
          elif userpref.active_section == 'ADDONS':
-             layout.operator("wm.addon_install", icon='FILESEL')
+             layout.operator("wm.addon_install", icon='FILEBROWSER')
              layout.operator("wm.addon_refresh", icon='FILE_REFRESH')
              layout.menu("USERPREF_MT_addons_online_resources")
+         elif userpref.active_section == 'LIGHTS':
+             layout.operator('wm.studiolight_install', text="Add MatCap").orientation = 'MATCAP'
+             layout.operator('wm.studiolight_install', text="Add World HDRI").orientation = 'WORLD'
+             layout.operator('wm.studiolight_install', text="Add Camera HDRI").orientation = 'CAMERA'
          elif userpref.active_section == 'THEMES':
-             layout.operator("ui.reset_default_theme")
-             layout.operator("wm.theme_install")
+             layout.operator("wm.theme_install", icon='FILEBROWSER')
+             layout.operator("ui.reset_default_theme", icon='LOOP_BACK')
+         layout.separator_spacer()
+         layout.operator_context = 'EXEC_AREA'
+         layout.operator("wm.save_userpref")
  
  
 -class USERPREF_PT_tabs(Panel):
 +class USERPREF_PT_navigation(Panel):
      bl_label = ""
      bl_space_type = 'USER_PREFERENCES'
 -    bl_region_type = 'WINDOW'
 +    bl_region_type = 'UI'
      bl_options = {'HIDE_HEADER'}
  
      def draw(self, context):
  
          userpref = context.user_preferences
  
 -        layout.row().prop(userpref, "active_section", expand=True)
 +        col = layout.column()
 +
 +        col.prop(userpref, "active_section", expand=True)
  
  
- class USERPREF_MT_interaction_presets(Menu):
-     bl_label = "Presets"
-     preset_subdir = "interaction"
-     preset_operator = "script.execute_preset"
-     draw = Menu.draw_preset
- class USERPREF_MT_app_templates(Menu):
-     bl_label = "Application Templates"
-     preset_subdir = "app_templates"
-     def draw_ex(self, context, *, use_splash=False, use_default=False, use_install=False):
-         import os
-         layout = self.layout
-         # now draw the presets
-         layout.operator_context = 'EXEC_DEFAULT'
-         if use_default:
-             props = layout.operator("wm.read_homefile", text="Default")
-             props.use_splash = True
-             props.app_template = ""
-             layout.separator()
-         template_paths = bpy.utils.app_template_paths()
-         # expand template paths
-         app_templates = []
-         for path in template_paths:
-             for d in os.listdir(path):
-                 if d.startswith(("__", ".")):
-                     continue
-                 template = os.path.join(path, d)
-                 if os.path.isdir(template):
-                     # template_paths_expand.append(template)
-                     app_templates.append(d)
-         for d in sorted(app_templates):
-             props = layout.operator(
-                 "wm.read_homefile",
-                 text=bpy.path.display_name(d),
-             )
-             props.use_splash = True
-             props.app_template = d
-         if use_install:
-             layout.separator()
-             layout.operator_context = 'INVOKE_DEFAULT'
-             props = layout.operator("wm.app_template_install")
-     def draw(self, context):
-         self.draw_ex(context, use_splash=False, use_default=True, use_install=True)
- class USERPREF_MT_templates_splash(Menu):
-     bl_label = "Startup Templates"
-     preset_subdir = "templates"
-     def draw(self, context):
-         USERPREF_MT_app_templates.draw_ex(self, context, use_splash=True, use_default=True)
- class USERPREF_MT_appconfigs(Menu):
-     bl_label = "AppPresets"
-     preset_subdir = "keyconfig"
-     preset_operator = "wm.appconfig_activate"
-     def draw(self, context):
-         self.layout.operator("wm.appconfig_default", text="Blender (default)")
-         # now draw the presets
-         Menu.draw_preset(self, context)
- class USERPREF_MT_splash(Menu):
-     bl_label = "Splash"
-     def draw(self, context):
-         layout = self.layout
-         split = layout.split()
-         row = split.row()
-         if any(bpy.utils.app_template_paths()):
-             row.label("Template:")
-             template = context.user_preferences.app_template
-             row.menu(
-                 "USERPREF_MT_templates_splash",
-                 text=bpy.path.display_name(template) if template else "Default",
-             )
-         else:
-             row.label("")
-         row = split.row()
-         row.label("Interaction:")
-         text = bpy.path.display_name(context.window_manager.keyconfigs.active.name)
-         if not text:
-             text = "Blender (default)"
-         row.menu("USERPREF_MT_appconfigs", text=text)
- # only for addons
- class USERPREF_MT_splash_footer(Menu):
-     bl_label = ""
-     def draw(self, context):
-         pass
  class USERPREF_PT_interface(Panel):
      bl_space_type = 'USER_PREFERENCES'
      bl_label = "Interface"
  
          col.separator()
  
-         col.label("Warnings")
-         col.prop(view, "use_quit_dialog")
+         # Toolbox doesn't exist yet
+         # col.label(text="Toolbox:")
+         #col.prop(view, "show_column_layout")
+         #col.label(text="Open Toolbox Delay:")
+         #col.prop(view, "open_left_mouse_delay", text="Hold LMB")
+         #col.prop(view, "open_right_mouse_delay", text="Hold RMB")
+         col.prop(view, "show_gizmo", text="Gizmos")
+         sub = col.column()
+         sub.active = view.show_gizmo
+         sub.prop(view, "gizmo_size", text="Size")
  
-         row.separator()
-         row.separator()
+         col.separator()
+         col.label(text="Development:")
+         col.prop(view, "show_tooltips_python")
+         col.prop(view, "show_developer_ui")
  
+         row = split.row()
+         row.separator()
          col = row.column()
-         col.label(text="View Manipulation:")
 -        col.label(text="View Gizmos:")
          col.prop(view, "use_mouse_depth_cursor")
          col.prop(view, "use_cursor_lock_adjust")
          col.prop(view, "use_mouse_depth_navigate")
@@@ -1583,18 -1479,103 +1480,103 @@@ class USERPREF_PT_addons(Panel)
                  row.label(text=module_name, translate=False)
  
  
+ class StudioLightPanelMixin():
+     bl_space_type = 'USER_PREFERENCES'
+     bl_region_type = 'WINDOW'
+     @classmethod
+     def poll(cls, context):
+         userpref = context.user_preferences
+         return (userpref.active_section == 'LIGHTS')
+     def _get_lights(self, userpref):
+         return [light for light in userpref.studio_lights if light.is_user_defined and light.orientation == self.sl_orientation]
+     def draw(self, context):
+         layout = self.layout
+         userpref = context.user_preferences
+         lights = self._get_lights(userpref)
+         if lights:
+             flow = layout.column_flow(columns=4)
+             for studio_light in lights:
+                 self.draw_studio_light(flow, studio_light)
+         else:
+             layout.label(text="No custom {} configured".format(self.bl_label))
+     def draw_studio_light(self, layout, studio_light):
+         box = layout.box()
+         row = box.row()
+         row.template_icon(layout.icon(studio_light), scale=6.0)
+         op = row.operator('wm.studiolight_uninstall', text="", icon='REMOVE')
+         op.index = studio_light.index
+         box.label(text=studio_light.name)
+ class USERPREF_PT_studiolight_matcaps(Panel, StudioLightPanelMixin):
+     bl_label = "MatCaps"
+     sl_orientation = 'MATCAP'
+ class USERPREF_PT_studiolight_world(Panel, StudioLightPanelMixin):
+     bl_label = "World HDRI"
+     sl_orientation = 'WORLD'
+ class USERPREF_PT_studiolight_camera(Panel, StudioLightPanelMixin):
+     bl_label = "Camera HDRI"
+     sl_orientation = 'CAMERA'
+ class USERPREF_PT_studiolight_specular(Panel, StudioLightPanelMixin):
+     bl_label = "Specular Lights"
+     sl_orientation = 'CAMERA'
+     @classmethod
+     def poll(cls, context):
+         userpref = context.user_preferences
+         return (userpref.active_section == 'LIGHTS')
+     def opengl_light_buttons(self, column, light):
+         split = column.split()
+         col = split.column()
+         col.prop(light, "use", text="Use", icon='OUTLINER_OB_LIGHT' if light.use else 'LIGHT_DATA')
+         sub = col.column()
+         sub.active = light.use
+         sub.prop(light, "specular_color")
+         col = split.column()
+         col.active = light.use
+         col.prop(light, "direction", text="")
+     def draw(self, context):
+         layout = self.layout
+         column = layout.split()
+         userpref = context.user_preferences
+         system = userpref.system
+         light = system.solid_lights[0]
+         colsplit = column.split(factor=0.85)
+         self.opengl_light_buttons(colsplit, light)
+         light = system.solid_lights[1]
+         colsplit = column.split(factor=0.85)
+         self.opengl_light_buttons(colsplit, light)
+         light = system.solid_lights[2]
+         self.opengl_light_buttons(column, light)
  classes = (
      USERPREF_HT_header,
 -    USERPREF_PT_tabs,
 +    USERPREF_PT_navigation,
-     USERPREF_MT_interaction_presets,
-     USERPREF_MT_templates_splash,
-     USERPREF_MT_app_templates,
-     USERPREF_MT_appconfigs,
-     USERPREF_MT_splash,
-     USERPREF_MT_splash_footer,
      USERPREF_PT_interface,
      USERPREF_PT_edit,
 -    USERPREF_PT_system,
 +    USERPREF_PT_system_general,
      USERPREF_MT_interface_theme_presets,
      USERPREF_PT_theme,
      USERPREF_PT_file,
index 4984a33df2b0e753f5763d97b8e0f34bd1235202,0d766e83299deb756f90b3cb8bb289dc9aa69e24..75d2ed0d0bc77b0b45fc15f2743a8bfbf04148db
@@@ -295,22 -319,20 +319,24 @@@ void BKE_spacedata_freelist(ListBase *l
  void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
  void BKE_spacedata_draw_locks(int set);
  
- void BKE_spacedata_callback_id_remap_set(void (*func)(struct ScrArea *, struct SpaceLink *, struct ID *, struct ID *));
 +struct ARegion *BKE_spacedata_find_region_type(
 +        const struct SpaceLink *slink, const struct ScrArea *sa,
 +        int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 +
+ void BKE_spacedata_callback_id_remap_set(
+         void (*func)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id));
  void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID *id);
  
  /* area/regions */
  struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar);
  void            BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
+ void            BKE_area_region_panels_free(struct ListBase *panels);
  void            BKE_screen_area_free(struct ScrArea *sa);
- /* Manipulator-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
- void BKE_region_callback_free_manipulatormap_set(void (*callback)(struct wmManipulatorMap *));
- void BKE_region_callback_refresh_tag_manipulatormap_set(void (*callback)(struct wmManipulatorMap *));
+ /* Gizmo-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
+ void BKE_region_callback_free_gizmomap_set(void (*callback)(struct wmGizmoMap *));
+ void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizmoMap *));
  
 -struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
 +struct ARegion *BKE_area_find_region_type(const struct ScrArea *sa, int type);
  struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
  struct ARegion *BKE_area_find_region_xy(struct ScrArea *sa, const int regiontype, int x, int y);
  struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
index 40822f08a142da2afba0270c4704a2451e172986,a28b4ae77844ddde12dbe7d9ccee15d27aa08c31..a24f9bd879055fa910a4de7834b0d7eeca6df96f
@@@ -939,28 -1207,1225 +1207,1209 @@@ void blo_do_versions_280(FileData *fd, 
                                probe->intensity = 1.0f;
                        }
                }
 -
 -              for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
 -                      bConstraint *con, *con_next;
 -                      con = ob->constraints.first;
 -                      while (con) {
 -                              con_next = con->next;
 -                              if (con->type == 17) { /* CONSTRAINT_TYPE_RIGIDBODYJOINT */
 -                                      BLI_remlink(&ob->constraints, con);
 -                                      BKE_constraint_free_data(con);
 -                                      MEM_freeN(con);
 -                              }
 -                              con = con_next;
 -                      }
 -              }
 -
 -              if (!DNA_struct_elem_find(fd->filesdna, "Scene", "int", "orientation_index_custom")) {
 -                      for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
 -                              scene->orientation_index_custom = -1;
 -                      }
 -              }
 -
 -              for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
 -                      for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
 -                              for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
 -                                      if (sl->spacetype == SPACE_VIEW3D) {
 -                                              View3D *v3d = (View3D *)sl;
 -                                              v3d->shading.light = V3D_LIGHTING_STUDIO;
 -                                              v3d->shading.flag |= V3D_SHADING_OBJECT_OUTLINE;
 -
 -                                              /* Assume (demo) files written with 2.8 want to show
 -                                               * Eevee renders in the viewport. */
 -                                              if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) {
 -                                                      v3d->drawtype = OB_MATERIAL;
 -                                              }
 -                                      }
 -                              }
 -                      }
 -              }
        }
  
-               for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) {
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 7)) {
+               /* Render engine storage moved elsewhere and back during 2.8
+                * development, we assume any files saved in 2.8 had Eevee set
+                * as scene render engine. */
+               if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 8)) {
+               /* Blender Internal removal */
+               for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                       if (STREQ(scene->r.engine, "BLENDER_RENDER") ||
+                           STREQ(scene->r.engine, "BLENDER_GAME"))
+                       {
+                               BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
+                       }
+                       scene->r.bake_mode = 0;
+               }
+               for (Tex *tex = bmain->tex.first; tex; tex = tex->id.next) {
+                       /* Removed envmap, pointdensity, voxeldata, ocean textures. */
+                       if (ELEM(tex->type, 10, 14, 15, 16)) {
+                               tex->type = 0;
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) {
+               /* Remove info editor, but only if at the top of the window. */
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       /* Calculate window width/height from screen vertices */
+                       int win_width = 0, win_height = 0;
+                       for (ScrVert *vert = screen->vertbase.first; vert; vert = vert->next) {
+                               win_width  = MAX2(win_width, vert->vec.x);
+                               win_height = MAX2(win_height, vert->vec.y);
+                       }
+                       for (ScrArea *area = screen->areabase.first, *area_next; area; area = area_next) {
+                               area_next = area->next;
+                               if (area->spacetype == SPACE_INFO) {
+                                       if ((area->v2->vec.y == win_height) && (area->v1->vec.x == 0) && (area->v4->vec.x == win_width)) {
+                                               BKE_screen_area_free(area);
+                                               BLI_remlink(&screen->areabase, area);
+                                               BKE_screen_remove_double_scredges(screen);
+                                               BKE_screen_remove_unused_scredges(screen);
+                                               BKE_screen_remove_unused_scrverts(screen);
+                                               MEM_freeN(area);
+                                       }
+                               }
+                               /* AREA_TEMP_INFO is deprecated from now on, it should only be set for info areas
+                                * which are deleted above, so don't need to unset it. Its slot/bit can be reused */
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) {
+               for (Lamp *lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
+                       if (lamp->mode & (1 << 13)) { /* LA_SHAD_RAY */
+                               lamp->mode |= LA_SHADOW;
+                               lamp->mode &= ~(1 << 13);
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 12)) {
+               /* Remove tool property regions. */
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_CLIP)) {
+                                               ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+                                               for (ARegion *region = regionbase->first, *region_next; region; region = region_next) {
+                                                       region_next = region->next;
+                                                       if (region->regiontype == RGN_TYPE_TOOL_PROPS) {
+                                                               BKE_area_region_free(NULL, region);
+                                                               BLI_freelinkN(regionbase, region);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 13)) {
+               /* Initialize specular factor. */
+               if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "spec_fac")) {
+                       for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
+                               la->spec_fac = 1.0f;
+                       }
+               }
+               /* Initialize new view3D options. */
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d = (View3D *)sl;
+                                               v3d->shading.light = V3D_LIGHTING_STUDIO;
+                                               v3d->shading.color_type = V3D_SHADING_MATERIAL_COLOR;
+                                               copy_v3_fl(v3d->shading.single_color, 0.8f);
+                                               v3d->shading.shadow_intensity = 0.5;
+                                               v3d->overlay.backwire_opacity = 0.5f;
+                                               v3d->overlay.normals_length = 0.1f;
+                                               v3d->overlay.flag = 0;
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_find(fd->filesdna, "View3DCursor")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               unit_qt(scene->cursor.rotation);
+                       }
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       unit_qt(v3d->cursor.rotation);
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 14)) {
+               if (!DNA_struct_elem_find(fd->filesdna, "Scene", "SceneDisplay", "display")) {
+                       /* Initialize new scene.SceneDisplay */
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               copy_v3_v3(scene->display.light_direction, (float[3]){-M_SQRT1_3, -M_SQRT1_3, M_SQRT1_3});
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "float", "shadow_shift")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->display.shadow_shift = 0.1;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "Object", "ObjectDisplay", "display")) {
+                       /* Initialize new object.ObjectDisplay */
+                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                               ob->display.flag = OB_SHOW_SHADOW;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "transform_pivot_point")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->toolsettings->transform_pivot_point = V3D_AROUND_CENTER_MEAN;
+                       }
+               }
+               if (!DNA_struct_find(fd->filesdna, "SceneEEVEE")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               /* First set the default for all the properties. */
+                               scene->eevee.gi_diffuse_bounces = 3;
+                               scene->eevee.gi_cubemap_resolution = 512;
+                               scene->eevee.gi_visibility_resolution = 32;
+                               scene->eevee.taa_samples = 16;
+                               scene->eevee.taa_render_samples = 64;
+                               scene->eevee.sss_samples = 7;
+                               scene->eevee.sss_jitter_threshold = 0.3f;
+                               scene->eevee.ssr_quality = 0.25f;
+                               scene->eevee.ssr_max_roughness = 0.5f;
+                               scene->eevee.ssr_thickness = 0.2f;
+                               scene->eevee.ssr_border_fade = 0.075f;
+                               scene->eevee.ssr_firefly_fac = 10.0f;
+                               scene->eevee.volumetric_start = 0.1f;
+                               scene->eevee.volumetric_end = 100.0f;
+                               scene->eevee.volumetric_tile_size = 8;
+                               scene->eevee.volumetric_samples = 64;
+                               scene->eevee.volumetric_sample_distribution = 0.8f;
+                               scene->eevee.volumetric_light_clamp = 0.0f;
+                               scene->eevee.volumetric_shadow_samples = 16;
+                               scene->eevee.gtao_distance = 0.2f;
+                               scene->eevee.gtao_factor = 1.0f;
+                               scene->eevee.gtao_quality = 0.25f;
+                               scene->eevee.bokeh_max_size = 100.0f;
+                               scene->eevee.bokeh_threshold = 1.0f;
+                               copy_v3_fl(scene->eevee.bloom_color, 1.0f);
+                               scene->eevee.bloom_threshold = 0.8f;
+                               scene->eevee.bloom_knee = 0.5f;
+                               scene->eevee.bloom_intensity = 0.8f;
+                               scene->eevee.bloom_radius = 6.5f;
+                               scene->eevee.bloom_clamp = 1.0f;
+                               scene->eevee.motion_blur_samples = 8;
+                               scene->eevee.motion_blur_shutter = 1.0f;
+                               scene->eevee.shadow_method = SHADOW_ESM;
+                               scene->eevee.shadow_cube_size = 512;
+                               scene->eevee.shadow_cascade_size = 1024;
+                               scene->eevee.flag =
+                                       SCE_EEVEE_VOLUMETRIC_LIGHTS |
+                                       SCE_EEVEE_GTAO_BENT_NORMALS |
+                                       SCE_EEVEE_GTAO_BOUNCE |
+                                       SCE_EEVEE_TAA_REPROJECTION |
+                                       SCE_EEVEE_SSR_HALF_RESOLUTION;
+                               /* If the file is pre-2.80 move on. */
+                               if (scene->layer_properties == NULL) {
+                                       continue;
+                               }
+                               /* Now we handle eventual properties that may be set in the file. */
+ #define EEVEE_GET_BOOL(_props, _name, _flag) \
+                               { \
+                                       IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+                                       if (_idprop != NULL) { \
+                                               const int _value = IDP_Int(_idprop); \
+                                               if (_value) { \
+                                                       scene->eevee.flag |= _flag; \
+                                               } \
+                                               else { \
+                                                       scene->eevee.flag &= ~_flag; \
+                                               } \
+                                       } \
+                               }
+ #define EEVEE_GET_INT(_props, _name) \
+                               { \
+                                       IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+                                       if (_idprop != NULL) { \
+                                               scene->eevee._name = IDP_Int(_idprop); \
+                                       } \
+                               }
+ #define EEVEE_GET_FLOAT(_props, _name) \
+                               { \
+                                       IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+                                       if (_idprop != NULL) { \
+                                               scene->eevee._name = IDP_Float(_idprop); \
+                                       } \
+                               }
+ #define EEVEE_GET_FLOAT_ARRAY(_props, _name, _length) \
+                               { \
+                                       IDProperty *_idprop = IDP_GetPropertyFromGroup(_props, #_name); \
+                                       if (_idprop != NULL) { \
+                                               const float *_values = IDP_Array(_idprop); \
+                                               for (int _i = 0; _i < _length; _i++) { \
+                                                       scene->eevee._name [_i] = _values[_i]; \
+                                               } \
+                                       } \
+                               }
+                               IDProperty *props = IDP_GetPropertyFromGroup(scene->layer_properties, RE_engine_id_BLENDER_EEVEE);
+                               EEVEE_GET_BOOL(props, volumetric_enable, SCE_EEVEE_VOLUMETRIC_ENABLED);
+                               EEVEE_GET_BOOL(props, volumetric_lights, SCE_EEVEE_VOLUMETRIC_LIGHTS);
+                               EEVEE_GET_BOOL(props, volumetric_shadows, SCE_EEVEE_VOLUMETRIC_SHADOWS);
+                               EEVEE_GET_BOOL(props, gtao_enable, SCE_EEVEE_GTAO_ENABLED);
+                               EEVEE_GET_BOOL(props, gtao_use_bent_normals, SCE_EEVEE_GTAO_BENT_NORMALS);
+                               EEVEE_GET_BOOL(props, gtao_bounce, SCE_EEVEE_GTAO_BOUNCE);
+                               EEVEE_GET_BOOL(props, dof_enable, SCE_EEVEE_DOF_ENABLED);
+                               EEVEE_GET_BOOL(props, bloom_enable, SCE_EEVEE_BLOOM_ENABLED);
+                               EEVEE_GET_BOOL(props, motion_blur_enable, SCE_EEVEE_MOTION_BLUR_ENABLED);
+                               EEVEE_GET_BOOL(props, shadow_high_bitdepth, SCE_EEVEE_SHADOW_HIGH_BITDEPTH);
+                               EEVEE_GET_BOOL(props, taa_reprojection, SCE_EEVEE_TAA_REPROJECTION);
+                               EEVEE_GET_BOOL(props, sss_enable, SCE_EEVEE_SSS_ENABLED);
+                               EEVEE_GET_BOOL(props, sss_separate_albedo, SCE_EEVEE_SSS_SEPARATE_ALBEDO);
+                               EEVEE_GET_BOOL(props, ssr_enable, SCE_EEVEE_SSR_ENABLED);
+                               EEVEE_GET_BOOL(props, ssr_refraction, SCE_EEVEE_SSR_REFRACTION);
+                               EEVEE_GET_BOOL(props, ssr_halfres, SCE_EEVEE_SSR_HALF_RESOLUTION);
+                               EEVEE_GET_INT(props, gi_diffuse_bounces);
+                               EEVEE_GET_INT(props, gi_diffuse_bounces);
+                               EEVEE_GET_INT(props, gi_cubemap_resolution);
+                               EEVEE_GET_INT(props, gi_visibility_resolution);
+                               EEVEE_GET_INT(props, taa_samples);
+                               EEVEE_GET_INT(props, taa_render_samples);
+                               EEVEE_GET_INT(props, sss_samples);
+                               EEVEE_GET_FLOAT(props, sss_jitter_threshold);
+                               EEVEE_GET_FLOAT(props, ssr_quality);
+                               EEVEE_GET_FLOAT(props, ssr_max_roughness);
+                               EEVEE_GET_FLOAT(props, ssr_thickness);
+                               EEVEE_GET_FLOAT(props, ssr_border_fade);
+                               EEVEE_GET_FLOAT(props, ssr_firefly_fac);
+                               EEVEE_GET_FLOAT(props, volumetric_start);
+                               EEVEE_GET_FLOAT(props, volumetric_end);
+                               EEVEE_GET_INT(props, volumetric_tile_size);
+                               EEVEE_GET_INT(props, volumetric_samples);
+                               EEVEE_GET_FLOAT(props, volumetric_sample_distribution);
+                               EEVEE_GET_FLOAT(props, volumetric_light_clamp);
+                               EEVEE_GET_INT(props, volumetric_shadow_samples);
+                               EEVEE_GET_FLOAT(props, gtao_distance);
+                               EEVEE_GET_FLOAT(props, gtao_factor);
+                               EEVEE_GET_FLOAT(props, gtao_quality);
+                               EEVEE_GET_FLOAT(props, bokeh_max_size);
+                               EEVEE_GET_FLOAT(props, bokeh_threshold);
+                               EEVEE_GET_FLOAT_ARRAY(props, bloom_color, 3);
+                               EEVEE_GET_FLOAT(props, bloom_threshold);
+                               EEVEE_GET_FLOAT(props, bloom_knee);
+                               EEVEE_GET_FLOAT(props, bloom_intensity);
+                               EEVEE_GET_FLOAT(props, bloom_radius);
+                               EEVEE_GET_FLOAT(props, bloom_clamp);
+                               EEVEE_GET_INT(props, motion_blur_samples);
+                               EEVEE_GET_FLOAT(props, motion_blur_shutter);
+                               EEVEE_GET_INT(props, shadow_method);
+                               EEVEE_GET_INT(props, shadow_cube_size);
+                               EEVEE_GET_INT(props, shadow_cascade_size);
+                               /* Cleanup. */
+                               IDP_FreeProperty(scene->layer_properties);
+                               MEM_freeN(scene->layer_properties);
+                               scene->layer_properties = NULL;
+ #undef EEVEE_GET_FLOAT_ARRAY
+ #undef EEVEE_GET_FLOAT
+ #undef EEVEE_GET_INT
+ #undef EEVEE_GET_BOOL
+                       }
+               }
+               if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->display.matcap_ssao_distance = 0.2f;
+                               scene->display.matcap_ssao_attenuation = 1.0f;
+                               scene->display.matcap_ssao_samples = 16;
+                       }
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_OUTLINER) {
+                                                       SpaceOops *soops = (SpaceOops *)sl;
+                                                       soops->filter_id_type = ID_GR;
+                                                       soops->outlinevis = SO_VIEW_LAYER;
+                                               }
+                                       }
+                               }
+                       }
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               switch (scene->toolsettings->snap_mode) {
+                                       case 0: scene->toolsettings->snap_mode = SCE_SNAP_MODE_INCREMENT; break;
+                                       case 1: scene->toolsettings->snap_mode = SCE_SNAP_MODE_VERTEX   ; break;
+                                       case 2: scene->toolsettings->snap_mode = SCE_SNAP_MODE_EDGE     ; break;
+                                       case 3: scene->toolsettings->snap_mode = SCE_SNAP_MODE_FACE     ; break;
+                                       case 4: scene->toolsettings->snap_mode = SCE_SNAP_MODE_VOLUME   ; break;
+                               }
+                               switch (scene->toolsettings->snap_node_mode) {
+                                       case 5: scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_NODE_X; break;
+                                       case 6: scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_NODE_Y; break;
+                                       case 7: scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_NODE_X | SCE_SNAP_MODE_NODE_Y; break;
+                                       case 8: scene->toolsettings->snap_node_mode = SCE_SNAP_MODE_GRID  ; break;
+                               }
+                               switch (scene->toolsettings->snap_uv_mode) {
+                                       case 0: scene->toolsettings->snap_uv_mode = SCE_SNAP_MODE_INCREMENT; break;
+                                       case 1: scene->toolsettings->snap_uv_mode = SCE_SNAP_MODE_VERTEX   ; break;
+                               }
+                       }
+                       ParticleSettings *part;
+                       for (part = bmain->particle.first; part; part = part->id.next) {
+                               part->shape_flag = PART_SHAPE_CLOSE_TIP;
+                               part->shape = 0.0f;
+                               part->rad_root = 1.0f;
+                               part->rad_tip = 0.0f;
+                               part->rad_scale = 0.01f;
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 18)) {
+               if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "roughness")) {
+                       for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) {
+                               if (mat->use_nodes) {
+                                       if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) {
+                                               mat->roughness = mat->gloss_mir;
+                                       }
+                                       else {
+                                               mat->roughness = 0.25f;
+                                       }
+                               }
+                               else {
+                                       mat->roughness = 1.0f - mat->gloss_mir;
+                               }
+                               mat->metallic = mat->ray_mirror;
+                       }
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->shading.flag |= V3D_SHADING_SPECULAR_HIGHLIGHT;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "xray_alpha")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->shading.xray_alpha = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "matcap[256]")) {
+                       StudioLight *default_matcap = BKE_studiolight_find_first(STUDIOLIGHT_ORIENTATION_VIEWNORMAL);
+                       /* when loading the internal file is loaded before the matcaps */
+                       if (default_matcap) {
+                               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                                               View3D *v3d = (View3D *)sl;
+                                                               BLI_strncpy(v3d->shading.matcap, default_matcap->name, FILE_MAXFILE);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "wireframe_threshold")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.wireframe_threshold = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "cavity_valley_factor")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->shading.cavity_valley_factor = 1.0f;
+                                                       v3d->shading.cavity_ridge_factor = 1.0f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "bone_select_alpha")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.bone_select_alpha = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 19)) {
+               if (!DNA_struct_elem_find(fd->filesdna, "Image", "ListBase", "renderslot")) {
+                       for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
+                               if (ima->type == IMA_TYPE_R_RESULT) {
+                                       for (int i = 0; i < 8; i++) {
+                                               RenderSlot *slot = MEM_callocN(sizeof(RenderSlot), "Image Render Slot Init");
+                                               BLI_snprintf(slot->name, sizeof(slot->name), "Slot %d", i + 1);
+                                               BLI_addtail(&ima->renderslots, slot);
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SpaceAction", "char", "mode_prev")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_ACTION) {
+                                                       SpaceAction *saction = (SpaceAction *)sl;
+                                                       /* "Dopesheet" should be default here, unless it looks like the Action Editor was active instead */
+                                                       if ((saction->mode_prev == 0) && (saction->action == NULL)) {
+                                                               saction->mode_prev = SACTCONT_DOPESHEET;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d = (View3D *)sl;
+                                               if (v3d->drawtype == OB_TEXTURE) {
+                                                       v3d->drawtype = OB_SOLID;
+                                                       v3d->shading.light = V3D_LIGHTING_STUDIO;
+                                                       v3d->shading.color_type = V3D_SHADING_TEXTURE_COLOR;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 21)) {
+               for (Scene *sce = bmain->scene.first; sce != NULL; sce = sce->id.next) {
+                       if (sce->ed != NULL && sce->ed->seqbase.first != NULL) {
+                               do_versions_seq_unique_name_all_strips(sce, &sce->ed->seqbase);
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "texture_paint_mode_opacity")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       float alpha = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 0.8f;
+                                                       float alpha_full = v3d->flag2 & V3D_SHOW_MODE_SHADE_OVERRIDE ? 0.0f : 1.0f;
+                                                       v3d->overlay.texture_paint_mode_opacity = alpha;
+                                                       v3d->overlay.vertex_paint_mode_opacity = alpha;
+                                                       v3d->overlay.weight_paint_mode_opacity = alpha_full;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShadeing", "char", "background_type")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       copy_v3_fl(v3d->shading.background_color, 0.05f);
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_cubemap_draw_size")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->eevee.gi_irradiance_draw_size = 0.1f;
+                               scene->eevee.gi_cubemap_draw_size = 0.3f;
+                       }
+               }
+               for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                       if (scene->toolsettings->gizmo_flag == 0) {
+                               scene->toolsettings->gizmo_flag = SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               RigidBodyWorld *rbw = scene->rigidbody_world;
+                               if (rbw == NULL) {
+                                       continue;
+                               }
+                               if (rbw->shared == NULL) {
+                                       rbw->shared = MEM_callocN(sizeof(*rbw->shared), "RigidBodyWorld_Shared");
+                               }
+                               /* Move shared pointers from deprecated location to current location */
+                               rbw->shared->pointcache = rbw->pointcache;
+                               rbw->shared->ptcaches = rbw->ptcaches;
+                               rbw->pointcache = NULL;
+                               BLI_listbase_clear(&rbw->ptcaches);
+                               if (rbw->shared->pointcache == NULL) {
+                                       rbw->shared->pointcache = BKE_ptcache_add(&(rbw->shared->ptcaches));
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SoftBody", "SoftBody_Shared", "*shared")) {
+                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                               SoftBody *sb = ob->soft;
+                               if (sb == NULL) {
+                                       continue;
+                               }
+                               if (sb->shared == NULL) {
+                                       sb->shared = MEM_callocN(sizeof(*sb->shared), "SoftBody_Shared");
+                               }
+                               /* Move shared pointers from deprecated location to current location */
+                               sb->shared->pointcache = sb->pointcache;
+                               sb->shared->ptcaches = sb->ptcaches;
+                               sb->pointcache = NULL;
+                               BLI_listbase_clear(&sb->ptcaches);
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "short", "type")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       if (v3d->drawtype == OB_RENDER) {
+                                                               v3d->drawtype = OB_SOLID;
+                                                       }
+                                                       v3d->shading.type = v3d->drawtype;
+                                                       v3d->shading.prev_type = OB_SOLID;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneDisplay", "View3DShading", "shading")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               BKE_screen_view3d_shading_init(&scene->display.shading);
+                       }
+               }
+               /* initialize grease pencil view data */
+               if (!DNA_struct_elem_find(fd->filesdna, "SpaceView3D", "float", "vertex_opacity")) {
+                       for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
+                               for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->vertex_opacity = 1.0f;
+                                                       v3d->gp_flag |= V3D_GP_SHOW_EDIT_LINES;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 22)) {
+               if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "annotate_v3d_align")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->toolsettings->annotate_v3d_align = GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR;
+                               scene->toolsettings->annotate_thickness = 3;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "bGPDlayer", "short", "line_change")) {
+                       for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
+                               for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+                                       gpl->line_change = gpl->thickness;
+                                       if ((gpl->thickness < 1) || (gpl->thickness > 10)) {
+                                               gpl->thickness = 3;
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_paper_opacity")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.gpencil_paper_opacity = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_grid_opacity")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.gpencil_grid_opacity = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               /* default loc axis */
+               if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "int", "lock_axis")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               /* lock axis */
+                               GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
+                               if (gset) {
+                                       gset->lock_axis = GP_LOCKAXIS_Y;
+                               }
+                       }
+               }
+               /* Versioning code for Subsurf modifier. */
+               if (!DNA_struct_elem_find(fd->filesdna, "SubsurfModifier", "short", "uv_smooth")) {
+                       for (Object *object = bmain->object.first; object != NULL; object = object->id.next) {
+                               for (ModifierData *md = object->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Subsurf) {
+                                               SubsurfModifierData *smd = (SubsurfModifierData *)md;
+                                               if (smd->flags & eSubsurfModifierFlag_SubsurfUv_DEPRECATED) {
+                                                       smd->uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_CORNERS;
+                                               }
+                                               else {
+                                                       smd->uv_smooth = SUBSURF_UV_SMOOTH_NONE;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SubsurfModifier", "short", "quality")) {
+                       for (Object *object = bmain->object.first; object != NULL; object = object->id.next) {
+                               for (ModifierData *md = object->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Subsurf) {
+                                               SubsurfModifierData *smd = (SubsurfModifierData *)md;
+                                               smd->quality = min_ii(smd->renderLevels, 3);
+                                       }
+                               }
+                       }
+               }
+               /* Versioning code for Multires modifier. */
+               if (!DNA_struct_elem_find(fd->filesdna, "MultiresModifier", "short", "quality")) {
+                       for (Object *object = bmain->object.first; object != NULL; object = object->id.next) {
+                               for (ModifierData *md = object->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Multires) {
+                                               MultiresModifierData *mmd = (MultiresModifierData *)md;
+                                               mmd->quality = 3;
+                                               if (mmd->flags & eMultiresModifierFlag_PlainUv_DEPRECATED) {
+                                                       mmd->uv_smooth = SUBSURF_UV_SMOOTH_NONE;
+                                               }
+                                               else {
+                                                       mmd->uv_smooth = SUBSURF_UV_SMOOTH_PRESERVE_CORNERS;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "ClothSimSettings", "short", "bending_model")) {
+                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                               for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Cloth) {
+                                               ClothModifierData *clmd = (ClothModifierData *)md;
+                                               clmd->sim_parms->bending_model = CLOTH_BENDING_LINEAR;
+                                               clmd->sim_parms->tension = clmd->sim_parms->structural;
+                                               clmd->sim_parms->compression = clmd->sim_parms->structural;
+                                               clmd->sim_parms->shear = clmd->sim_parms->structural;
+                                               clmd->sim_parms->max_tension = clmd->sim_parms->max_struct;
+                                               clmd->sim_parms->max_compression = clmd->sim_parms->max_struct;
+                                               clmd->sim_parms->max_shear = clmd->sim_parms->max_struct;
+                                               clmd->sim_parms->vgroup_shear = clmd->sim_parms->vgroup_struct;
+                                               clmd->sim_parms->tension_damp = clmd->sim_parms->Cdis;
+                                               clmd->sim_parms->compression_damp = clmd->sim_parms->Cdis;
+                                               clmd->sim_parms->shear_damp = clmd->sim_parms->Cdis;
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "float", "era_strength_f")) {
+                       for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) {
+                               if (brush->gpencil_settings != NULL) {
+                                       BrushGpencilSettings *gp = brush->gpencil_settings;
+                                       if (gp->brush_type == GPAINT_TOOL_ERASE) {
+                                               gp->era_strength_f = 100.0f;
+                                               gp->era_thickness_f = 10.0f;
+                                       }
+                               }
+                       }
+               }
+               for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                       for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
+                               if (md->type == eModifierType_Cloth) {
+                                       ClothModifierData *clmd = (ClothModifierData *)md;
+                                       if (!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)) {
+                                               clmd->sim_parms->vgroup_mass = 0;
+                                       }
+                                       if (!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING)) {
+                                               clmd->sim_parms->vgroup_struct = 0;
+                                               clmd->sim_parms->vgroup_shear = 0;
+                                               clmd->sim_parms->vgroup_bend = 0;
+                                       }
+                                       if (!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW)) {
+                                               clmd->sim_parms->shrink_min = 0.0f;
+                                               clmd->sim_parms->vgroup_shrink = 0;
+                                       }
+                                       if (!(clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_ENABLED)) {
+                                               clmd->coll_parms->flags &= ~CLOTH_COLLSETTINGS_FLAG_SELF;
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 24)) {
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d = (View3D *)sl;
+                                               v3d->overlay.edit_flag |= V3D_OVERLAY_EDIT_FACES |
+                                                                         V3D_OVERLAY_EDIT_SEAMS |
+                                                                         V3D_OVERLAY_EDIT_SHARP |
+                                                                         V3D_OVERLAY_EDIT_FREESTYLE_EDGE |
+                                                                         V3D_OVERLAY_EDIT_FREESTYLE_FACE |
+                                                                         V3D_OVERLAY_EDIT_EDGES |
+                                                                         V3D_OVERLAY_EDIT_CREASES |
+                                                                         V3D_OVERLAY_EDIT_BWEIGHTS |
+                                                                         V3D_OVERLAY_EDIT_CU_HANDLES |
+                                                                         V3D_OVERLAY_EDIT_CU_NORMALS;
+                                       }
+                               }
+                       }
+               }
+       }
+       {
+               if (!DNA_struct_elem_find(fd->filesdna, "ShrinkwrapModifierData", "char", "shrinkMode")) {
+                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                               for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Shrinkwrap) {
+                                               ShrinkwrapModifierData *smd = (ShrinkwrapModifierData *)md;
+                                               if (smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE) {
+                                                       smd->shrinkMode = MOD_SHRINKWRAP_ABOVE_SURFACE;
+                                                       smd->shrinkOpts &= ~MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 24)) {
+               if (!DNA_struct_elem_find(fd->filesdna, "PartDeflect", "float", "pdef_cfrict")) {
+                       for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                               if (ob->pd) {
+                                       ob->pd->pdef_cfrict = 5.0f;
+                               }
+                               for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Cloth) {
+                                               ClothModifierData *clmd = (ClothModifierData *)md;
+                                               clmd->coll_parms->selfepsilon = 0.015f;
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "xray_alpha_wire")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->shading.xray_alpha_wire = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->shading.flag |= V3D_SHADING_XRAY_WIREFRAME;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 25)) {
+               for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                       UnitSettings *unit = &scene->unit;
+                       if (unit->system != USER_UNIT_NONE) {
+                               unit->length_unit = bUnit_GetBaseUnitOfType(scene->unit.system, B_UNIT_LENGTH);
+                               unit->mass_unit = bUnit_GetBaseUnitOfType(scene->unit.system, B_UNIT_MASS);
+                       }
+                       unit->time_unit = bUnit_GetBaseUnitOfType(USER_UNIT_NONE, B_UNIT_TIME);
+               }
+               /* gpencil grid settings */
+               for (bGPdata *gpd = bmain->gpencil.first; gpd; gpd = gpd->id.next) {
+                       ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); // Color
+                       ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); // Scale
+                       gpd->grid.lines = GP_DEFAULT_GRID_LINES; // Number of lines
+               }
+       }
+       {
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d = (View3D *)sl;
+                                               if (v3d->flag2 & V3D_OCCLUDE_WIRE) {
+                                                       v3d->overlay.edit_flag |= V3D_OVERLAY_EDIT_OCCLUDE_WIRE;
+                                                       v3d->flag2 &= ~V3D_OCCLUDE_WIRE;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 29)) {
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                       if (sl->spacetype == SPACE_BUTS) {
+                                               ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+                                               ARegion *ar = MEM_callocN(sizeof(ARegion), "navigation bar for properties");
+                                               ARegion *ar_header = NULL;
+                                               for (ar_header = regionbase->first; ar_header; ar_header = ar_header->next) {
+                                                       if (ar_header->regiontype == RGN_TYPE_HEADER) {
+                                                               break;
+                                                       }
+                                               }
+                                               BLI_assert(ar_header);
+                                               BLI_insertlinkafter(regionbase, ar_header, ar);
+                                               ar->regiontype = RGN_TYPE_NAV_BAR;
+                                               ar->alignment = RGN_ALIGN_LEFT;
+                                       }
+                               }
+                       }
+               }
+               /* grease pencil fade layer opacity */
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "gpencil_fade_layer")) {
+                       for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                               for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+                                       for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.gpencil_fade_layer = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+                       ob->empty_image_visibility_flag = (
+                               OB_EMPTY_IMAGE_VISIBLE_PERSPECTIVE |
+                               OB_EMPTY_IMAGE_VISIBLE_ORTHOGRAPHIC |
+                               OB_EMPTY_IMAGE_VISIBLE_BACKSIDE);
+               }
+       }
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 30)) {
+               /* grease pencil main material show switches */
+               for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) {
+                       if (mat->gp_style) {
+                               mat->gp_style->flag |= GP_STYLE_STROKE_SHOW;
+                               mat->gp_style->flag |= GP_STYLE_FILL_SHOW;
+                       }
+               }
+       }
+       {
+               /* Grease pencil reset sculpt brushes after struct rename  */
+               if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "int", "weighttype")) {
+                       float curcolor_add[3], curcolor_sub[3];
+                       ARRAY_SET_ITEMS(curcolor_add, 1.0f, 0.6f, 0.6f);
+                       ARRAY_SET_ITEMS(curcolor_sub, 0.6f, 0.6f, 1.0f);
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               /* sculpt brushes */
+                               GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
+                               if (gset) {
+                                       for (int i = 0; i < GP_SCULPT_TYPE_MAX; i++) {
+                                               GP_Sculpt_Data *gp_brush = &gset->brush[i];
+                                               gp_brush->size = 30;
+                                               gp_brush->strength = 0.5f;
+                                               gp_brush->flag = GP_SCULPT_FLAG_USE_FALLOFF | GP_SCULPT_FLAG_ENABLE_CURSOR;
+                                               copy_v3_v3(gp_brush->curcolor_add, curcolor_add);
+                                               copy_v3_v3(gp_brush->curcolor_sub, curcolor_sub);
+                                       }
+                               }
+                       }
+               }
+               /* Grease pencil target weight  */
+               if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "float", "target_weight")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               /* sculpt brushes */
+                               GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
+                               if (gset) {
+                                       for (int i = 0; i < GP_SCULPT_TYPE_MAX; i++) {
+                                               GP_Sculpt_Data *gp_brush = &gset->brush[i];
+                                               gp_brush->target_weight = 1.0f;
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "overscan")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->eevee.overscan = 3.0f;
+                       }
+               }
+               for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
+                       /* Removed Hemi lights. */
+                       if (!ELEM(la->type, LA_LOCAL, LA_SUN, LA_SPOT, LA_AREA)) {
+                               la->type = LA_SUN;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "light_threshold")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->eevee.light_threshold = 0.01f;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_irradiance_smoothing")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->eevee.gi_irradiance_smoothing = 0.1f;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "SceneEEVEE", "float", "gi_filter_quality")) {
+                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+                               scene->eevee.gi_filter_quality = 1.0f;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "att_dist")) {
+                       for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
+                               la->att_dist = la->clipend;
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "Brush", "char", "weightpaint_tool")) {
+                       /* Magic defines from old files (2.7x) */
+ #define PAINT_BLEND_MIX 0
+ #define PAINT_BLEND_ADD 1
+ #define PAINT_BLEND_SUB 2
+ #define PAINT_BLEND_MUL 3
+ #define PAINT_BLEND_BLUR 4
+ #define PAINT_BLEND_LIGHTEN 5
+ #define PAINT_BLEND_DARKEN 6
+ #define PAINT_BLEND_AVERAGE 7
+ #define PAINT_BLEND_SMEAR 8
+ #define PAINT_BLEND_COLORDODGE 9
+ #define PAINT_BLEND_DIFFERENCE 10
+ #define PAINT_BLEND_SCREEN 11
+ #define PAINT_BLEND_HARDLIGHT 12
+ #define PAINT_BLEND_OVERLAY 13
+ #define PAINT_BLEND_SOFTLIGHT 14
+ #define PAINT_BLEND_EXCLUSION 15
+ #define PAINT_BLEND_LUMINOSITY 16
+ #define PAINT_BLEND_SATURATION 17
+ #define PAINT_BLEND_HUE 18
+ #define PAINT_BLEND_ALPHA_SUB 19
+ #define PAINT_BLEND_ALPHA_ADD 20
+                       for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) {
+                               if (brush->ob_mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) {
+                                       const char tool_init = brush->vertexpaint_tool;
+                                       bool is_blend = false;
+                                       {
+                                               char tool = tool_init;
+                                               switch (tool_init) {
+                                                       case PAINT_BLEND_MIX: tool = VPAINT_TOOL_DRAW; break;
+                                                       case PAINT_BLEND_BLUR: tool = VPAINT_TOOL_BLUR; break;
+                                                       case PAINT_BLEND_AVERAGE: tool = VPAINT_TOOL_AVERAGE; break;
+                                                       case PAINT_BLEND_SMEAR: tool = VPAINT_TOOL_SMEAR; break;
+                                                       default:
+                                                               tool = VPAINT_TOOL_DRAW;
+                                                               is_blend = true;
+                                                               break;
+                                               }
+                                               brush->vertexpaint_tool = tool;
+                                       }
+                                       if (is_blend == false) {
+                                               brush->blend = IMB_BLEND_MIX;
+                                       }
+                                       else {
+                                               short blend = IMB_BLEND_MIX;
+                                               switch (tool_init) {
+                                                       case PAINT_BLEND_ADD: blend = IMB_BLEND_ADD; break;
+                                                       case PAINT_BLEND_SUB: blend = IMB_BLEND_SUB; break;
+                                                       case PAINT_BLEND_MUL: blend = IMB_BLEND_MUL; break;
+                                                       case PAINT_BLEND_LIGHTEN: blend = IMB_BLEND_LIGHTEN; break;
+                                                       case PAINT_BLEND_DARKEN: blend = IMB_BLEND_DARKEN; break;
+                                                       case PAINT_BLEND_COLORDODGE: blend = IMB_BLEND_COLORDODGE; break;
+                                                       case PAINT_BLEND_DIFFERENCE: blend = IMB_BLEND_DIFFERENCE; break;
+                                                       case PAINT_BLEND_SCREEN: blend = IMB_BLEND_SCREEN; break;
+                                                       case PAINT_BLEND_HARDLIGHT: blend = IMB_BLEND_HARDLIGHT; break;
+                                                       case PAINT_BLEND_OVERLAY: blend = IMB_BLEND_OVERLAY; break;
+                                                       case PAINT_BLEND_SOFTLIGHT: blend = IMB_BLEND_SOFTLIGHT; break;
+                                                       case PAINT_BLEND_EXCLUSION: blend = IMB_BLEND_EXCLUSION; break;
+                                                       case PAINT_BLEND_LUMINOSITY: blend = IMB_BLEND_LUMINOSITY; break;
+                                                       case PAINT_BLEND_SATURATION: blend = IMB_BLEND_SATURATION; break;
+                                                       case PAINT_BLEND_HUE: blend = IMB_BLEND_HUE; break;
+                                                       case PAINT_BLEND_ALPHA_SUB: blend = IMB_BLEND_ERASE_ALPHA; break;
+                                                       case PAINT_BLEND_ALPHA_ADD: blend = IMB_BLEND_ADD_ALPHA; break;
+                                               }
+                                               brush->blend = blend;
+                                       }
+                               }
+                               /* For now these match, in the future new items may not. */
+                               brush->weightpaint_tool = brush->vertexpaint_tool;
+                       }
+ #undef PAINT_BLEND_MIX
+ #undef PAINT_BLEND_ADD
+ #undef PAINT_BLEND_SUB
+ #undef PAINT_BLEND_MUL
+ #undef PAINT_BLEND_BLUR
+ #undef PAINT_BLEND_LIGHTEN
+ #undef PAINT_BLEND_DARKEN
+ #undef PAINT_BLEND_AVERAGE
+ #undef PAINT_BLEND_SMEAR
+ #undef PAINT_BLEND_COLORDODGE
+ #undef PAINT_BLEND_DIFFERENCE
+ #undef PAINT_BLEND_SCREEN
+ #undef PAINT_BLEND_HARDLIGHT
+ #undef PAINT_BLEND_OVERLAY
+ #undef PAINT_BLEND_SOFTLIGHT
+ #undef PAINT_BLEND_EXCLUSION
+ #undef PAINT_BLEND_LUMINOSITY
+ #undef PAINT_BLEND_SATURATION
+ #undef PAINT_BLEND_HUE
+ #undef PAINT_BLEND_ALPHA_SUB
+ #undef PAINT_BLEND_ALPHA_ADD
+               }
+       }
 +      {
++              for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
 +                      for (ScrArea *area = screen->areabase.first; area; area = area->next) {
 +                              for (SpaceLink *slink = area->spacedata.first; slink; slink = slink->next) {
 +                                      if (slink->spacetype == SPACE_USERPREF) {
 +                                              ARegion *navigation_region = BKE_spacedata_find_region_type(slink, area, RGN_TYPE_UI);
 +
 +                                              if (!navigation_region) {
 +                                                      ListBase *regionbase = (slink == area->spacedata.first) ?
 +                                                                                 &area->regionbase : &slink->regionbase;
 +
 +                                                      navigation_region = MEM_callocN(sizeof(ARegion), "userpref navigation-region do_versions");
 +
 +                                                      BLI_addhead(regionbase, navigation_region); /* order matters, addhead not addtail! */
 +                                                      navigation_region->regiontype = RGN_TYPE_UI;
 +                                                      navigation_region->alignment = RGN_ALIGN_LEFT;
 +                                              }
 +                                      }
 +                              }
 +                      }
 +              }
 +      }
  }
index 59c639776ef79954673b15e1f13b1c25e17803f6,5e8b420e018771bc597f34ccc07f68fd5a4ea158..9aa36d29237e978cfb5102cce2bb0aae7f45cfa0
@@@ -625,21 -687,15 +687,29 @@@ static void ui_item_enum_expand_exec
        }
  
        for (item = item_array; item->identifier; item++) {
 +              const bool is_first = item == item_array;
 +
                if (!item->identifier[0]) {
-                       if (name) {
 -                      const EnumPropertyItem *next_item = item + 1;
 -                      if (next_item->identifier) {
 -                              if (radial && layout_radial) {
 -                                      uiItemS(layout_radial);
 -                              }
 -                              else {
++                      if (item->name) {
 +                              size_t group_name_len = strlen(item->name) + 2;
 +                              char *group_name = alloca(group_name_len);
 +
 +                              if (!is_first) {
                                        uiItemS(block->curlayout);
                                }
-                       else if (radial && layout_radial) {
-                               uiItemS(layout_radial);
 +                              BLI_snprintf(group_name, group_name_len, "%s:", item->name);
 +                              uiItemL(block->curlayout, group_name, ICON_NONE);
 +                      }
++                      else {
++                              const EnumPropertyItem *next_item = item + 1;
++                              if (next_item->identifier) {
++                                      if (radial && layout_radial) {
++                                              uiItemS(layout_radial);
++                                      }
++                                      else {
++                                              uiItemS(block->curlayout);
++                                      }
++                              }
                        }
                        continue;
                }
index 210fce5fba5c81902f0f38f11ef3aa96a3d48d4c,6a9f1e13aeab17663b5c9ce421116862a79187d8..249db645e2ca7558f9356cec8584f956223dbd50
@@@ -3996,16 -4329,16 +4329,16 @@@ static void SCREEN_OT_back_to_previous(
  /** \} */
  
  /* -------------------------------------------------------------------- */
- /** \name Show Blender Settings Operator
+ /** \name Show User Preferences Operator
   * \{ */
  
 -static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 +static int settings_show_invoke(bContext *C, wmOperator *op, const wmEvent *event)
  {
-       const int sizex = (800 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
-       const int sizey = 500 * UI_DPI_FAC;
 -      int sizex = 800 * UI_DPI_FAC;
++      int sizex = (800 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
+       int sizey = 500 * UI_DPI_FAC;
  
        /* changes context! */
 -      if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) {
 +      if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_SETTINGS) != NULL) {
                return OPERATOR_FINISHED;
        }
        else {
@@@ -4352,11 -4814,12 +4814,12 @@@ void ED_operatortypes_screen(void
        WM_operatortype_append(SCREEN_OT_back_to_previous);
        WM_operatortype_append(SCREEN_OT_spacedata_cleanup);
        WM_operatortype_append(SCREEN_OT_screenshot);
-       WM_operatortype_append(SCREEN_OT_screencast);
 -      WM_operatortype_append(SCREEN_OT_userpref_show);
 +      WM_operatortype_append(SCREEN_OT_settings_show);
+       WM_operatortype_append(SCREEN_OT_drivers_editor_show);
        WM_operatortype_append(SCREEN_OT_region_blend);
        WM_operatortype_append(SCREEN_OT_space_context_cycle);
-       
+       WM_operatortype_append(SCREEN_OT_workspace_cycle);
        /*frame changes*/
        WM_operatortype_append(SCREEN_OT_frame_offset);
        WM_operatortype_append(SCREEN_OT_frame_jump);
index 430c37d4aa78d852ae5c9234b0e0991196536585,06c6e612f13f4fb3713bee7ac9dde29ca6a36eac..7e0ee9a0e7200c259a6c50377f00b83b09a5d2fb
@@@ -145,21 -136,8 +145,21 @@@ static void userpref_header_region_draw
        ED_region_header(C, ar);
  }
  
-       ED_region_panels(C, ar, NULL, -1, true);
 +/* add handlers, stuff you only do once or on area/region changes */
 +static void userpref_navigation_region_init(wmWindowManager *wm, ARegion *ar)
 +{
 +      ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
 +
 +      ED_region_panels_init(wm, ar);
 +}
 +
 +static void userpref_navigation_region_draw(const bContext *C, ARegion *ar)
 +{
++      ED_region_panels(C, ar);
 +}
 +
  static void userpref_main_region_listener(
-         bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
+         wmWindow *UNUSED(win), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
          wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene))
  {
        /* context changes */
@@@ -178,13 -156,6 +178,13 @@@ static void userpref_header_listener
  #endif
  }
  
-         bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
 +static void userpref_navigation_region_listener(
++        wmWindow *UNUSED(win), ScrArea *UNUSED(sa), ARegion *UNUSED(ar),
 +        wmNotifier *UNUSED(wmn), const Scene *UNUSED(scene))
 +{
 +      /* context changes */
 +}
 +
  /* only called once, from space/spacetypes.c */
  void ED_spacetype_userpref(void)
  {
index d1eda36f3e35607a585f2137f07fa9ffc5943251,c9d163516356e7b72039f5a2694b32638e168251..7f1eace6c9c2cde6a32a86c5671dfebacdb56407
@@@ -474,8 -541,10 +542,10 @@@ typedef struct UserDef 
         * which are outside the scope of typical preferences. */
        short app_flag;
        short language;
-       short userpref, viewzoom;
+       short userpref;
 -      char  userpref_flag;
++      char userpref_flag;
+       char viewzoom;
 -
 +      
        int mixbufsize;
        int audiodevice;
        int audiorate;
@@@ -601,30 -677,24 +678,37 @@@ extern UserDef U; /* from blenkernel bl
  
  /* ***************** USERDEF ****************** */
  
 +/* Toggles for unfinished 2.8 UserPref design. */
 +//#define WITH_USERDEF_WORKSPACES
 +//#define WITH_USERDEF_SYSTEM_SPLIT
 +
  /* UserDef.userpref (UI active_section) */
  typedef enum eUserPref_Section {
 -      USER_SECTION_INTERFACE  = 0,
 -      USER_SECTION_EDIT               = 1,
 -      USER_SECTION_FILE               = 2,
 -      USER_SECTION_SYSTEM             = 3,
 -      USER_SECTION_THEME              = 4,
 -      USER_SECTION_INPUT              = 5,
 -      USER_SECTION_ADDONS     = 6,
 -      USER_SECTION_LIGHT      = 7,
 +      USER_SECTION_INTERFACE         = 0,
 +      USER_SECTION_EDIT              = 1,
 +      USER_SECTION_FILE              = 2,
 +      USER_SECTION_SYSTEM_GENERAL    = 3,
 +      USER_SECTION_THEME             = 4,
 +      USER_SECTION_INPUT             = 5,
 +      USER_SECTION_ADDONS            = 6,
++      USER_SECTION_LIGHT             = 7,
 +#ifdef WITH_USERDEF_WORKSPACES
-       USER_SECTION_WORKSPACE_CONFIG  = 7,
-       USER_SECTION_WORKSPACE_ADDONS  = 8,
-       USER_SECTION_WORKSPACE_KEYMAPS = 9,
++      USER_SECTION_WORKSPACE_CONFIG  = 8,
++      USER_SECTION_WORKSPACE_ADDONS  = 9,
++      USER_SECTION_WORKSPACE_KEYMAPS = 10,
 +#endif
 +#ifdef WITH_USERDEF_SYSTEM_SPLIT
-       USER_SECTION_SYSTEM_DRAWING    = 10,
-       USER_SECTION_SYSTEM_DEVICES    = 11,
++      USER_SECTION_SYSTEM_DRAWING    = 11,
++      USER_SECTION_SYSTEM_DEVICES    = 12,
 +#endif
  } eUserPref_Section;
  
+ /* UserDef.userpref_flag (State of the user preferences UI). */
+ typedef enum eUserPref_SectionFlag {
+       /* Hide/expand keymap preferences. */
+       USER_SECTION_INPUT_HIDE_UI_KEYCONFIG        = (1 << 0),
+ } eUserPref_SectionFlag;
  /* UserDef.flag */
  typedef enum eUserPref_Flag {
        USER_AUTOSAVE                   = (1 << 0),
index 7c68ca0562985a20d2c70e98d27adbad69c84cde,03f86eba601f321763f655d51745a928bddc4d68..1a74ff9a121093822964dd4de86acdee294db31a
@@@ -4706,19 -4930,9 +4931,20 @@@ void RNA_def_userdef(BlenderRNA *brna
                {USER_SECTION_INPUT, "INPUT", 0, "Input", ""},
                {USER_SECTION_ADDONS, "ADDONS", 0, "Add-ons", ""},
                {USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
+               {USER_SECTION_LIGHT, "LIGHTS", 0, "Lights", ""},
                {USER_SECTION_FILE, "FILES", 0, "File", ""},
 -              {USER_SECTION_SYSTEM, "SYSTEM", 0, "System", ""},
 +#ifdef WITH_USERDEF_WORKSPACES
 +              {0, "", 0, "Workspaces", ""},
 +              {USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""},
 +              {USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""},
 +              {USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""},
 +#endif
 +              {0, "", 0, "System", ""},
 +              {USER_SECTION_SYSTEM_GENERAL, "SYSTEM_GENERAL", 0, "General", ""},
 +#ifdef WITH_USERDEF_SYSTEM_SPLIT
 +              {USER_SECTION_SYSTEM_DRAWING, "SYSTEM_DRAWING", 0, "Drawing", ""},
 +              {USER_SECTION_SYSTEM_DEVICES, "SYSTEM_DEVICES", 0, "Devices", ""},
 +#endif
                {0, NULL, 0, NULL, NULL}
        };
  
index c9ccdb80cc4eb543dc277b6f0b3f6a5c52e80d20,8e12ac96ea3ec9781542456f7bd8f8275e6b69ac..4662855bef65228a872d6e5f56c8fea507a9f870
@@@ -129,7 -140,8 +140,8 @@@ void WM_opengl_context_release(void *co
  /* defines for 'type' WM_window_open_temp */
  enum {
        WM_WINDOW_RENDER = 1,
 -      WM_WINDOW_USERPREFS,
 +      WM_WINDOW_SETTINGS,
+       WM_WINDOW_DRIVERS,
        // WM_WINDOW_FILESEL // UNUSED
  };
  
index f52880342846bc369bde87d9828e5d2b52e51330,df20dbd8055bb4f38adef707fdf56918a9a567de..7f5aea9a840edb36381482a3d6d2b77bdec9f209
@@@ -936,9 -954,11 +954,11 @@@ wmWindow *WM_window_open_temp(bContext 
        if (sa->spacetype == SPACE_IMAGE)
                title = IFACE_("Blender Render");
        else if (ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF))
 -              title = IFACE_("Blender User Preferences");
 +              title = IFACE_("Blender Settings");
        else if (sa->spacetype == SPACE_FILE)
                title = IFACE_("Blender File View");
+       else if (sa->spacetype == SPACE_IPO)
+               title = IFACE_("Blender Drivers Editor");
        else
                title = "Blender";
  
diff --cc source/tools
index 7695e14cfc5820ac66546e0e515914d85ab81af3,5162393c104d6d5f0314183a084875fff68f28bb..30d4611eacb1c5b27a5e9d2432cb12843054abc9
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit 7695e14cfc5820ac66546e0e515914d85ab81af3
 -Subproject commit 5162393c104d6d5f0314183a084875fff68f28bb
++Subproject commit 30d4611eacb1c5b27a5e9d2432cb12843054abc9