Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-05 09:08:28 +0300
committerCampbell Barton <campbell@blender.org>2022-10-07 02:50:17 +0300
commit781d03efe4b889089c261de68bf25263454ddf29 (patch)
tree5f60a7a46cc6899d8e519b125807c77777dc18b8 /release/scripts/startup
parent4eb3e7ff8612c89909cb6ec3944924979e8a15c5 (diff)
Preferences: support loading factory settings only for app-templates
When app-templates are enabled, support resetting defaults only for the app-templates. Without this, it's not possible to reset app-template preferences without also resetting the default preferences for all settings the app-template does not override (used when there is no application template loaded, and other app-templates). These additional menu items are shown in menus when an app-template has been loaded. Address issue raised by T96427. Reviewed By: mont29, brecht Ref D16150
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py9
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py11
2 files changed, 18 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index b1ddd2c611d..3320e1e24a7 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -411,9 +411,16 @@ class TOPBAR_MT_file_defaults(Menu):
app_template, has_ext=False))
layout.operator("wm.save_homefile")
- props = layout.operator("wm.read_factory_settings")
if app_template:
+ display_name = bpy.path.display_name(iface_(app_template))
+ props = layout.operator("wm.read_factory_settings", text="Load Factory Blender Settings")
props.app_template = app_template
+ props = layout.operator("wm.read_factory_settings", text="Load Factory %s Settings" % display_name)
+ props.app_template = app_template
+ props.use_factory_startup_app_template_only = True
+ del display_name
+ else:
+ layout.operator("wm.read_factory_settings")
# Include technical operators here which would otherwise have no way for users to access.
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 441babefd60..a9736feb057 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -109,7 +109,16 @@ class USERPREF_MT_save_load(Menu):
sub_revert.operator("wm.read_userpref", text="Revert to Saved Preferences")
layout.operator_context = 'INVOKE_AREA'
- layout.operator("wm.read_factory_userpref", text="Load Factory Preferences")
+
+ app_template = prefs.app_template
+ if app_template:
+ display_name = bpy.path.display_name(iface_(app_template))
+ layout.operator("wm.read_factory_userpref", text="Load Factory Blender Preferences")
+ props = layout.operator("wm.read_factory_userpref", text="Load Factory %s Preferences" % display_name)
+ props.use_factory_startup_app_template_only = True
+ del display_name
+ else:
+ layout.operator("wm.read_factory_userpref", text="Load Factory Preferences")
class USERPREF_PT_save_preferences(Panel):