diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-15 17:41:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-15 17:41:38 +0400 |
commit | 84c40629283616cd11efb22d5865ace111b6c652 (patch) | |
tree | 669072299bf260d7f592d5ee4bf03c780c50cba7 | |
parent | 1e291017ca5a8831bbdc5714c54573bb6de3fcf1 (diff) |
bugfix [#23833] Console Errors (Keymaps)
dont allow non-existing preset paths to be passed to the preset menu.
-rw-r--r-- | release/scripts/modules/bpy/utils.py | 8 | ||||
-rw-r--r-- | release/scripts/modules/bpy_types.py | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py index b6fc221217b..1e08196e07a 100644 --- a/release/scripts/modules/bpy/utils.py +++ b/release/scripts/modules/bpy/utils.py @@ -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): diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 80309b0d91e..261165d8830 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -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 = [] |