Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/blendfile.c
| Show All 31 Lines | |||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| #include "BKE_addon.h" | |||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_blender.h" | #include "BKE_blender.h" | ||||
| #include "BKE_blender_version.h" | #include "BKE_blender_version.h" | ||||
| #include "BKE_blendfile.h" | #include "BKE_blendfile.h" | ||||
| #include "BKE_bpath.h" | #include "BKE_bpath.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_ipo.h" | #include "BKE_ipo.h" | ||||
| ▲ Show 20 Lines • Show All 499 Lines • ▼ Show 20 Lines | UserDef *BKE_blendfile_userdef_read_from_memory(const void *filebuf, | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_reports_prepend(reports, "Loading failed: "); | BKE_reports_prepend(reports, "Loading failed: "); | ||||
| } | } | ||||
| return userdef; | return userdef; | ||||
| } | } | ||||
| UserDef *BKE_blendfile_userdef_from_defaults(void) | |||||
| { | |||||
| UserDef *userdef = MEM_mallocN(sizeof(*userdef), __func__); | |||||
| memcpy(userdef, &U_default, sizeof(UserDef)); | |||||
| /* Add-ons. */ | |||||
| { | |||||
| const char *addons[] = { | |||||
| "io_anim_bvh", | |||||
| "io_curve_svg", | |||||
| "io_mesh_ply", | |||||
| "io_mesh_stl", | |||||
| "io_mesh_uv_layout", | |||||
| "io_scene_fbx", | |||||
| "io_scene_gltf2", | |||||
| "io_scene_obj", | |||||
| "io_scene_x3d", | |||||
| }; | |||||
| for (int i; i < ARRAY_SIZE(addons); i++) { | |||||
| bAddon *addon = BKE_addon_new(); | |||||
| STRNCPY(addon->module, addons[i]); | |||||
| BLI_addtail(&userdef->addons, addon); | |||||
| } | |||||
| } | |||||
| return userdef; | |||||
| } | |||||
| /** | /** | ||||
| * Only write the userdef in a .blend | * Only write the userdef in a .blend | ||||
| * \return success | * \return success | ||||
| */ | */ | ||||
| bool BKE_blendfile_userdef_write(const char *filepath, ReportList *reports) | bool BKE_blendfile_userdef_write(const char *filepath, ReportList *reports) | ||||
| { | { | ||||
| Main *mainb = MEM_callocN(sizeof(Main), "empty main"); | Main *mainb = MEM_callocN(sizeof(Main), "empty main"); | ||||
| bool ok = false; | bool ok = false; | ||||
| ▲ Show 20 Lines • Show All 266 Lines • Show Last 20 Lines | |||||