From f7adb788287665092fa2811de2ba70341aab3294 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 31 Jul 2019 21:46:13 +1000 Subject: Cleanup: remove BLO_update_defaults_userpref_blend Merge into BKE_blendfile_userdef_from_defaults --- source/blender/blenkernel/intern/blendfile.c | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 813275e097d..08630bf4e9f 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -43,15 +43,18 @@ #include "BKE_blender_version.h" #include "BKE_blendfile.h" #include "BKE_bpath.h" +#include "BKE_colorband.h" #include "BKE_context.h" #include "BKE_global.h" #include "BKE_ipo.h" +#include "BKE_keyconfig.h" #include "BKE_layer.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_report.h" #include "BKE_scene.h" #include "BKE_screen.h" +#include "BKE_studiolight.h" #include "BKE_workspace.h" #include "BLO_readfile.h" @@ -579,6 +582,32 @@ UserDef *BKE_blendfile_userdef_from_defaults(void) } } + /* default so DPI is detected automatically */ + userdef->dpi = 0; + userdef->ui_scale = 1.0f; + +#ifdef WITH_PYTHON_SECURITY + /* use alternative setting for security nuts + * otherwise we'd need to patch the binary blob - startup.blend.c */ + userdef->flag |= USER_SCRIPT_AUTOEXEC_DISABLE; +#else + userdef->flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE; +#endif + + /* System-specific fonts directory. */ + BKE_appdir_font_folder_default(userdef->fontdir); + + userdef->memcachelimit = min_ii(BLI_system_memory_max_in_megabytes_int() / 2, 4096); + + /* Init weight paint range. */ + BKE_colorband_init(&userdef->coba_weight, true); + + /* Default to left click select. */ + BKE_keyconfig_pref_set_select_mouse(userdef, 0, true); + + /* Default studio light. */ + BKE_studiolight_default(userdef->light_param, userdef->light_ambient); + return userdef; } -- cgit v1.2.3