Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/blendfile.c
| Show First 20 Lines • Show All 664 Lines • ▼ Show 20 Lines | WorkspaceConfigFileData *BKE_blendfile_workspace_config_read(const char *filepath, | ||||
| if (filepath) { | if (filepath) { | ||||
| bfd = BLO_read_from_file(filepath, BLO_READ_SKIP_USERDEF, reports); | bfd = BLO_read_from_file(filepath, BLO_READ_SKIP_USERDEF, reports); | ||||
| } | } | ||||
| else { | else { | ||||
| bfd = BLO_read_from_memory(filebuf, filelength, BLO_READ_SKIP_USERDEF, reports); | bfd = BLO_read_from_memory(filebuf, filelength, BLO_READ_SKIP_USERDEF, reports); | ||||
| } | } | ||||
| if (bfd) { | if (bfd) { | ||||
| workspace_config = MEM_mallocN(sizeof(*workspace_config), __func__); | workspace_config = MEM_callocN(sizeof(*workspace_config), __func__); | ||||
| workspace_config->main = bfd->main; | workspace_config->main = bfd->main; | ||||
| /* Only 2.80+ files have actual workspaces, don't try to use screens | |||||
| * from older versions. */ | |||||
| if (bfd->main->versionfile >= 280) { | |||||
| workspace_config->workspaces = bfd->main->workspaces; | workspace_config->workspaces = bfd->main->workspaces; | ||||
| } | |||||
| MEM_freeN(bfd); | MEM_freeN(bfd); | ||||
| } | } | ||||
| return workspace_config; | return workspace_config; | ||||
| } | } | ||||
| bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, ReportList *reports) | bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, ReportList *reports) | ||||
| ▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines | |||||