Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-07-30 04:04:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-07-31 14:36:12 +0300
commit07499c04f6126b325e1d6db68e430f36b514b355 (patch)
tree5c07ee1906eb4b4f2d11187ea36eee742fbe25cd /source/blender/blenkernel
parent86029b507194fb88a8eb9c86c83255d76adbafed (diff)
Preferences: don't store preferences in the startup
Simplify preferences by removing the ability to load them from either the startup.blend or userpref.blend. Also simplifies updating default preferences by moving them to a struct definition.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_blendfile.h1
-rw-r--r--source/blender/blenkernel/CMakeLists.txt1
-rw-r--r--source/blender/blenkernel/intern/blendfile.c30
3 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_blendfile.h b/source/blender/blenkernel/BKE_blendfile.h
index 7fc27321fc7..2bff684948d 100644
--- a/source/blender/blenkernel/BKE_blendfile.h
+++ b/source/blender/blenkernel/BKE_blendfile.h
@@ -52,6 +52,7 @@ struct UserDef *BKE_blendfile_userdef_read(const char *filepath, struct ReportLi
struct UserDef *BKE_blendfile_userdef_read_from_memory(const void *filebuf,
int filelength,
struct ReportList *reports);
+struct UserDef *BKE_blendfile_userdef_from_defaults(void);
bool BKE_blendfile_userdef_write(const char *filepath, struct ReportList *reports);
bool BKE_blendfile_userdef_write_app_template(const char *filepath, struct ReportList *reports);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index e564e91749c..d9bd87d97b5 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -58,6 +58,7 @@ set(INC_SYS
)
set(SRC
+ ${CMAKE_SOURCE_DIR}/release/datafiles/userdef/userdef_default.c
intern/CCGSubSurf.c
intern/CCGSubSurf_legacy.c
intern/CCGSubSurf_opensubdiv.c
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index e31494ecb4e..813275e097d 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -37,6 +37,7 @@
#include "IMB_colormanagement.h"
+#include "BKE_addon.h"
#include "BKE_appdir.h"
#include "BKE_blender.h"
#include "BKE_blender_version.h"
@@ -552,6 +553,35 @@ UserDef *BKE_blendfile_userdef_read_from_memory(const void *filebuf,
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
* \return success