WorkSpace: UI filtering for add-ons

Allows for each workspace to have it's own add-ons on display.

Filtering for: Panels, Menus, Keymaps & Manipulators.
Automatically applies to add-ons at the moment.

Access from workspace, toggled off by default
once enabled, add-ons can be white-listed.

See D3076
This commit is contained in:
2018-03-01 01:26:02 +11:00
parent 80d1d9629e
commit d937d06c02
26 changed files with 402 additions and 2 deletions

View File

@@ -352,6 +352,11 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
# 2) try register collected modules
# removed, addons need to handle own registration now.
from _bpy import _bl_owner_id_get, _bl_owner_id_set
owner_id_prev = _bl_owner_id_get()
_bl_owner_id_set(module_name)
# 3) try run the modules register function
try:
mod.register()
@@ -363,6 +368,8 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
if default_set:
_addon_remove(module_name)
return None
finally:
_bl_owner_id_set(owner_id_prev)
# * OK loaded successfully! *
mod.__addon_enabled__ = True