Skip to content

Commit

Permalink
UPBGE: Fix default auto exec option for new created user prefs. (#809)
Browse files Browse the repository at this point in the history
When the user pref config isn't saved, blender load one from memory and
call the function BLO_update_defaults_userpref_blend to initialize properly
the preferences such as the auto exec script option defaulted to true.

Unfortunatly this function is called after the check of the option
and so for blender auto exec is always false until the user saves the
preferences and reload.

Also the cmake option WITH_PYTHON_SECURITY is defaulted to OFF to avoid
new users compiling the software been blocked by this it.
  • Loading branch information
panzergame authored Sep 2, 2018
1 parent b7105d0 commit 3883d6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ mark_as_advanced(WITH_BLENDER)
option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)

option(WITH_PYTHON "Enable Embedded Python API (only disable for development)" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" OFF)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.

Expand Down
10 changes: 5 additions & 5 deletions source/blender/windowmanager/intern/wm_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,11 @@ static void wm_init_userdef(Main *bmain, const bool read_userdef_from_memory)
/* versioning is here */
UI_init_userdef(bmain);

/* avoid re-saving for every small change to our prefs, allow overrides */
if (read_userdef_from_memory) {
BLO_update_defaults_userpref_blend();
}

MEM_CacheLimiter_set_maximum(((size_t)U.memcachelimit) * 1024 * 1024);
BKE_sound_init(bmain);

Expand All @@ -336,11 +341,6 @@ static void wm_init_userdef(Main *bmain, const bool read_userdef_from_memory)
SET_FLAG_FROM_TEST(G.f, (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0, G_SCRIPT_AUTOEXEC);
}

/* avoid re-saving for every small change to our prefs, allow overrides */
if (read_userdef_from_memory) {
BLO_update_defaults_userpref_blend();
}

/* update tempdir from user preferences */
BKE_tempdir_init(U.tempdir);
}
Expand Down

0 comments on commit 3883d6a

Please sign in to comment.