diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_userpref.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 26facd25174..56bcd2870c2 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1371,8 +1371,13 @@ class USERPREF_PT_addons(Panel): userpref = context.user_preferences used_ext = {ext.module for ext in userpref.addons} - userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons") - scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons") + addon_user_dirs = tuple( + p for p in ( + os.path.join(userpref.filepaths.script_directory, "addons"), + bpy.utils.user_resource('SCRIPTS', "addons"), + ) + if p + ) # collect the categories that can be filtered on addons = [ @@ -1429,12 +1434,13 @@ class USERPREF_PT_addons(Panel): continue # check if addon should be visible with current filters - if ((filter == "All") or - (filter == info["category"]) or - (filter == "Enabled" and is_enabled) or + if ( + (filter == "All") or + (filter == info["category"]) or + (filter == "Enabled" and is_enabled) or (filter == "Disabled" and not is_enabled) or - (filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder)))) - ): + (filter == "User" and (mod.__file__.startswith(addon_user_dirs))) + ): if search and search not in info["name"].lower(): if info["author"]: if search not in info["author"].lower(): |