Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_studiolight.h" | #include "BKE_studiolight.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| /** | /** | ||||
| * Override values in in-memory startup.blend, avoids re-saving for small changes. | * Update in-memory preferences with system specific values. | ||||
| */ | */ | ||||
| void BLO_update_defaults_userpref_blend(void) | void BLO_update_defaults_userpref_blend(void) | ||||
| { | { | ||||
| /* default so DPI is detected automatically */ | /* default so DPI is detected automatically */ | ||||
| U.dpi = 0; | U.dpi = 0; | ||||
| U.ui_scale = 1.0f; | U.ui_scale = 1.0f; | ||||
| #ifdef WITH_PYTHON_SECURITY | #ifdef WITH_PYTHON_SECURITY | ||||
| /* use alternative setting for security nuts | /* use alternative setting for security nuts | ||||
| * otherwise we'd need to patch the binary blob - startup.blend.c */ | * otherwise we'd need to patch the binary blob - startup.blend.c */ | ||||
| U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE; | U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE; | ||||
| #else | #else | ||||
| U.flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE; | U.flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE; | ||||
| #endif | #endif | ||||
| /* Transform tweak with single click and drag. */ | |||||
| U.flag |= USER_RELEASECONFIRM; | |||||
| U.flag &= ~(USER_DEVELOPER_UI | USER_TOOLTIPS_PYTHON); | |||||
| /* Clear addon preferences. */ | |||||
| for (bAddon *addon = U.addons.first, *addon_next; addon != NULL; addon = addon_next) { | |||||
| addon_next = addon->next; | |||||
| if (addon->prop) { | |||||
| IDP_FreeProperty(addon->prop); | |||||
| addon->prop = NULL; | |||||
| } | |||||
| } | |||||
| /* Ignore the theme saved in the blend file, | |||||
| * instead use the theme from 'userdef_default_theme.c' */ | |||||
| { | |||||
| bTheme *theme = U.themes.first; | |||||
| memcpy(theme, &U_theme_default, sizeof(bTheme)); | |||||
| } | |||||
| /* Leave temp directory empty, will then get appropriate value per OS. */ | |||||
| U.tempdir[0] = '\0'; | |||||
| /* System-specific fonts directory. */ | /* System-specific fonts directory. */ | ||||
| BKE_appdir_font_folder_default(U.fontdir); | BKE_appdir_font_folder_default(U.fontdir); | ||||
| /* Only enable tooltips translation by default, | |||||
| * without actually enabling translation itself, for now. */ | |||||
| U.transopts = USER_TR_TOOLTIPS; | |||||
| U.memcachelimit = min_ii(BLI_system_memory_max_in_megabytes_int() / 2, 4096); | U.memcachelimit = min_ii(BLI_system_memory_max_in_megabytes_int() / 2, 4096); | ||||
| /* Auto perspective. */ | |||||
| U.uiflag |= USER_AUTOPERSP; | |||||
| /* Init weight paint range. */ | /* Init weight paint range. */ | ||||
| BKE_colorband_init(&U.coba_weight, true); | BKE_colorband_init(&U.coba_weight, true); | ||||
| /* Default visible section. */ | |||||
| U.userpref = USER_SECTION_INTERFACE; | |||||
| /* Default to left click select. */ | /* Default to left click select. */ | ||||
| BKE_keyconfig_pref_set_select_mouse(&U, 0, true); | BKE_keyconfig_pref_set_select_mouse(&U, 0, true); | ||||
| /* Increase a little for new scrubbing area. */ | |||||
| U.v2d_min_gridsize = 45; | |||||
| /* Default studio light. */ | /* Default studio light. */ | ||||
| BKE_studiolight_default(U.light_param, U.light_ambient); | BKE_studiolight_default(U.light_param, U.light_ambient); | ||||
| } | } | ||||
| /** | /** | ||||
| * Rename if the ID doesn't exist. | * Rename if the ID doesn't exist. | ||||
| */ | */ | ||||
| static ID *rename_id_for_versioning(Main *bmain, | static ID *rename_id_for_versioning(Main *bmain, | ||||
| ▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines | |||||