Merge branch 'master' into sculpt-dev
This commit is contained in:
@@ -49,6 +49,7 @@ def keyconfig_data_oskey_from_ctrl_for_macos(keyconfig_data_src):
|
||||
'W',
|
||||
'ACCENT_GRAVE',
|
||||
'PERIOD',
|
||||
'TAB',
|
||||
}):
|
||||
if (not item_event.get("alt")) and (not item_event.get("shift")):
|
||||
return False
|
||||
|
||||
@@ -201,12 +201,13 @@ _display_name_literals = {
|
||||
}
|
||||
|
||||
|
||||
def display_name(name, *, has_ext=True):
|
||||
def display_name(name, *, has_ext=True, title_case=True):
|
||||
"""
|
||||
Creates a display string from name to be used menus and the user interface.
|
||||
Capitalize the first letter in all lowercase names,
|
||||
mixed case names are kept as is. Intended for use with
|
||||
filenames and module names.
|
||||
Intended for use with filenames and module names.
|
||||
|
||||
:arg has_ext: Remove file extension from name
|
||||
:arg title_case: Convert lowercase names to title case
|
||||
"""
|
||||
|
||||
if has_ext:
|
||||
@@ -220,7 +221,7 @@ def display_name(name, *, has_ext=True):
|
||||
# (when paths can't start with numbers for eg).
|
||||
name = name.replace("_", " ").lstrip(" ")
|
||||
|
||||
if name.islower():
|
||||
if title_case and name.islower():
|
||||
name = name.lower().title()
|
||||
|
||||
name = _clean_utf8(name)
|
||||
|
||||
@@ -606,7 +606,7 @@ def preset_find(name, preset_path, display_name=False, ext=".py"):
|
||||
if display_name:
|
||||
filename = ""
|
||||
for fn in _os.listdir(directory):
|
||||
if fn.endswith(ext) and name == _bpy.path.display_name(fn):
|
||||
if fn.endswith(ext) and name == _bpy.path.display_name(fn, title_case=False):
|
||||
filename = fn
|
||||
break
|
||||
else:
|
||||
@@ -624,7 +624,7 @@ def keyconfig_init():
|
||||
active_config = _preferences.keymap.active_keyconfig
|
||||
|
||||
# Load the default key configuration.
|
||||
default_filepath = preset_find("blender", "keyconfig")
|
||||
default_filepath = preset_find("Blender", "keyconfig")
|
||||
keyconfig_set(default_filepath)
|
||||
|
||||
# Set the active key configuration if different
|
||||
|
||||
@@ -982,6 +982,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
|
||||
props_default=props_default,
|
||||
filter_ext=lambda ext: ext.lower() in ext_valid,
|
||||
add_operator=add_operator,
|
||||
display_name=lambda name: bpy.path.display_name(name, title_case=False)
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user