Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/workspace_edit.c
| Show First 20 Lines • Show All 332 Lines • ▼ Show 20 Lines | static int workspace_append_activate_exec(bContext *C, wmOperator *op) | ||||
| RNA_string_get(op->ptr, "idname", idname); | RNA_string_get(op->ptr, "idname", idname); | ||||
| RNA_string_get(op->ptr, "filepath", filepath); | RNA_string_get(op->ptr, "filepath", filepath); | ||||
| WorkSpace *appended_workspace = (WorkSpace *)WM_file_append_datablock( | WorkSpace *appended_workspace = (WorkSpace *)WM_file_append_datablock( | ||||
| C, filepath, ID_WS, idname); | C, filepath, ID_WS, idname); | ||||
| if (appended_workspace) { | if (appended_workspace) { | ||||
| /* Set defaults. */ | /* Set defaults. */ | ||||
| BLO_update_defaults_workspace(appended_workspace, NULL); | BLO_update_defaults_workspace(appended_workspace, NULL, bmain); | ||||
| /* Reorder to last position. */ | /* Reorder to last position. */ | ||||
| BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); | BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); | ||||
| /* Changing workspace changes context. Do delayed! */ | /* Changing workspace changes context. Do delayed! */ | ||||
| WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); | WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); | ||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| ▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines | |||||