bugfix [#23833] Console Errors (Keymaps)

dont allow non-existing preset paths to be passed to the preset menu.
This commit is contained in:
Campbell Barton
2010-09-15 13:41:38 +00:00
parent 1e291017ca
commit 84c4062928
2 changed files with 9 additions and 2 deletions

View File

@@ -271,8 +271,12 @@ def preset_paths(subdir):
"""
Returns a list of paths for a specific preset.
"""
return (_os.path.join(_presets, subdir), )
dirs = []
for path in script_paths("presets"):
directory = _os.path.join(path, subdir)
if _os.path.isdir(directory):
dirs.append(directory)
return dirs
def smpte_from_seconds(time, fps=None):

View File

@@ -739,6 +739,9 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
import bpy.utils
layout = self.layout
if not searchpaths:
layout.label("* Missing Paths *")
# collect paths
files = []