Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/workspace.c
| Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
| * | * | ||||
| * Should something like a bke_internal.h be added, this should go there! | * Should something like a bke_internal.h be added, this should go there! | ||||
| */ | */ | ||||
| void BKE_workspace_free(WorkSpace *workspace) | void BKE_workspace_free(WorkSpace *workspace) | ||||
| { | { | ||||
| BKE_workspace_relations_free(&workspace->hook_layout_relations); | BKE_workspace_relations_free(&workspace->hook_layout_relations); | ||||
| BKE_workspace_relations_free(&workspace->scene_viewlayer_relations); | BKE_workspace_relations_free(&workspace->scene_viewlayer_relations); | ||||
| BLI_freelistN(&workspace->bl_origins); | |||||
| BLI_freelistN(&workspace->layouts); | BLI_freelistN(&workspace->layouts); | ||||
| BLI_freelistN(&workspace->transform_orientations); | BLI_freelistN(&workspace->transform_orientations); | ||||
| BKE_viewrender_free(&workspace->view_render); | BKE_viewrender_free(&workspace->view_render); | ||||
| } | } | ||||
| /** | /** | ||||
| * Remove \a workspace by freeing itself and its data. This is a higher-level wrapper that | * Remove \a workspace by freeing itself and its data. This is a higher-level wrapper that | ||||
| ▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Lines | if (view_layer) { | ||||
| BLI_assert(BKE_object_is_in_editmode(obedit)); | BLI_assert(BKE_object_is_in_editmode(obedit)); | ||||
| return obedit; | return obedit; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| bool BKE_workspace_bl_origins_check( | |||||
| const WorkSpace *workspace, const char *bl_origin) | |||||
| { | |||||
| if ((*bl_origin == '\0') || | |||||
| ((workspace->flags & WORKSPACE_USE_UI_TAGS) == 0)) | |||||
| { | |||||
| return true; | |||||
| } | |||||
| else { | |||||
| /* we could use hash lookup, for now this list is highly under < ~16 items. */ | |||||
| return BLI_findstring(&workspace->bl_origins, bl_origin, offsetof(wmBLOrigin, name)) != NULL; | |||||
| } | |||||
| } | |||||