From 1ad1ecf1c93d375aae623eff6bab8cbb7d33a63a Mon Sep 17 00:00:00 2001 From: Ankur Deria Date: Wed, 3 Feb 2021 17:32:31 -0700 Subject: Fix T79822: Custom preset casing not preserved When adding a new preset the name would be converted to lower case and then displayed in the interface in title case. This was confusing because the name didn't reflect what was typed, and there are many cases when the name shouldn't be forced into title case (like 8K UHDTV for example). This commit leaves the custom preset names in the original casing, and removes the conversion of filenames to title case for preset lists. Differential Revision: https://developer.blender.org/D10224 --- release/scripts/startup/bl_operators/presets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 793a8648ee4..5132b358f5e 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -77,7 +77,7 @@ class AddPresetBase: setattr(cls, attr, trans) return trans - name = name.lower().strip() + name = name.strip() name = bpy.path.display_name_to_filepath(name) trans = maketrans_init() # Strip surrounding "_" as they are displayed as spaces. @@ -249,7 +249,7 @@ class ExecutePreset(Operator): # change the menu title to the most recently chosen option preset_class = getattr(bpy.types, self.menu_idname) - preset_class.bl_label = bpy.path.display_name(basename(filepath)) + preset_class.bl_label = bpy.path.display_name(basename(filepath), title_case=False) ext = splitext(filepath)[1].lower() -- cgit v1.2.3