diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-28 17:26:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-28 17:31:07 +0300 |
commit | d937d06c02f62c11385c1c1f58d963fec03365d9 (patch) | |
tree | c9a7052205b4cbcc4c9219ed2e9838cc5414c56c /source/blender/blenkernel/intern/workspace.c | |
parent | 80d1d9629e1d4dd12aca580e3844a24f5d160356 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r-- | source/blender/blenkernel/intern/workspace.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c index 9251c6630a5..301084e22fc 100644 --- a/source/blender/blenkernel/intern/workspace.c +++ b/source/blender/blenkernel/intern/workspace.c @@ -169,6 +169,7 @@ void BKE_workspace_free(WorkSpace *workspace) BKE_workspace_relations_free(&workspace->hook_layout_relations); BKE_workspace_relations_free(&workspace->scene_viewlayer_relations); + BLI_freelistN(&workspace->owner_ids); BLI_freelistN(&workspace->layouts); BLI_freelistN(&workspace->transform_orientations); @@ -535,3 +536,16 @@ Object *BKE_workspace_edit_object(WorkSpace *workspace, Scene *scene) return NULL; } +bool BKE_workspace_owner_id_check( + const WorkSpace *workspace, const char *owner_id) +{ + if ((*owner_id == '\0') || + ((workspace->flags & WORKSPACE_USE_FILTER_BY_ORIGIN) == 0)) + { + return true; + } + else { + /* we could use hash lookup, for now this list is highly under < ~16 items. */ + return BLI_findstring(&workspace->owner_ids, owner_id, offsetof(wmOwnerID, name)) != NULL; + } +} |