Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-03-01 03:20:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-03-01 03:22:46 +0300
commit61c8ed40f5df897da212b55dadeee252c8d3997b (patch)
tree45b820095458d8c4bdc891cb07b9273a2597f057 /release/scripts/startup/bl_ui/properties_data_workspace.py
parent33b6f944c673bf76de9d5ed955f0e6ab1fe10aac (diff)
WorkSpace: show/hode opt-out support for addons
In some cases it doesn't make sense for add-ons to be listed for hiding. Especially for import/export which use minimal UI space. This adds `bl_info["use_owner"]` to add-ons, currently defaulting to True for all non Import-Export add-ons.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_workspace.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_workspace.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_workspace.py b/release/scripts/startup/bl_ui/properties_data_workspace.py
index 1ece70f5e14..73da32f6eb9 100644
--- a/release/scripts/startup/bl_ui/properties_data_workspace.py
+++ b/release/scripts/startup/bl_ui/properties_data_workspace.py
@@ -80,15 +80,14 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
col.active = workspace.use_filter_by_owner
import addon_utils
- addon_map = {
- mod.__name__: ("%s: %s" % (mod.bl_info["category"], mod.bl_info["name"]))
- for mod in addon_utils.modules()
- }
+ addon_map = {mod.__name__: mod for mod in addon_utils.modules()}
owner_ids = {owner_id.name for owner_id in workspace.owner_ids}
for addon in userpref.addons:
module_name = addon.module
- text = addon_map[module_name]
+ info = addon_utils.module_bl_info(addon_map[module_name])
+ if not info["use_owner"]:
+ continue
is_enabled = module_name in owner_ids
row = col.row()
row.operator(
@@ -97,7 +96,7 @@ class WORKSPACE_PT_owner_ids(WorkSpaceButtonsPanel, Panel):
text="",
emboss=False,
).owner_id = module_name
- row.label(text)
+ row.label("%s: %s" % (info["category"], info["name"]))
if is_enabled:
owner_ids.remove(module_name)