diff options
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index b6a9b2f2f62..5eb8b946568 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -727,7 +727,7 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): def path_menu(self, searchpaths, operator, *, props_default=None, prop_filepath="filepath", - filter_ext=None, display_name=None): + filter_ext=None, filter_path=None, display_name=None): """ Populate a menu from a list of paths. @@ -761,12 +761,15 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): # collect paths files = [] for directory in searchpaths: - files.extend([(f, os.path.join(directory, f)) - for f in os.listdir(directory) - if (not f.startswith(".")) - if ((filter_ext is None) or - (filter_ext(os.path.splitext(f)[1]))) - ]) + files.extend( + [(f, os.path.join(directory, f)) + for f in os.listdir(directory) + if (not f.startswith(".")) + if ((filter_ext is None) or + (filter_ext(os.path.splitext(f)[1]))) + if ((filter_path is None) or + (filter_path(f))) + ]) files.sort() |