diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-08-28 10:36:54 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-08-28 10:36:54 +0400 |
commit | 771906bc09317e3dc77be2319b44bc59081eff93 (patch) | |
tree | 2b6386aa5cdadfd52bc3b036feee3b00b6c87793 /release/scripts/modules/bl_i18n_utils/utils.py | |
parent | f75711db7fd3565925880f8a2ea89088334c35bf (diff) |
Fix for #36387, User Preferences "Addons" panel bogs down the whole interface.
The addons panel draw function calls addon_utils.modules() which in turn retrieves a list of fake modules from the script paths every time. This can become costly when network paths are included for
addons. Solution is to put the scanning process into a dedicated "refresh" function and disable it in frequently called draw and filter functions, i.e. in these cases the cached addons_fake_modules list
will be used instead.
Note that this may lead to invalid addon lists if script paths are changed (which is not working 100% without restart anyway according to Campbell). For this there is now a "Refresh" operator button in
the addons preferences. If necessary and feasible such forced refreshes can be added later too.
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/utils.py')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 636e9a4a148..1b6d65d89d0 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -172,7 +172,7 @@ def enable_addons(addons={}, support={}, disable=False, check_only=False): userpref = bpy.context.user_preferences used_ext = {ext.module for ext in userpref.addons} - ret = [mod for mod in addon_utils.modules(addon_utils.addons_fake_modules) + ret = [mod for mod in addon_utils.modules() if ((addons and mod.__name__ in addons) or (not addons and addon_utils.module_bl_info(mod)["support"] in support))] |