[Bf-blender-cvs] [270fb4d82b0] master: Preferences: use the users temp directory in background mode

Campbell Barton noreply at git.blender.org
Sun Oct 4 16:30:36 CEST 2020


Commit: 270fb4d82b0fc807e7ff192edd5309a359fdd0b8
Author: Campbell Barton
Date:   Mon Oct 5 01:25:20 2020 +1100
Branches: master
https://developer.blender.org/rB270fb4d82b0fc807e7ff192edd5309a359fdd0b8

Preferences: use the users temp directory in background mode

This choice was made when preferences were not read in background mode,
so the temp dir needed to be initialized with something.
See bc9848f7e67c3e695403179f8bcdb78b0e5764a3.

Now preferences are always read there is no reason to ignore this
particular preference in background mode.

Anyone wanting to do background renders that ignore their preferences
can run with factory startup.

===================================================================

M	source/blender/windowmanager/intern/wm_files.c
M	source/creator/creator.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 69b7c7bb1e3..23571395e24 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -415,7 +415,7 @@ static void wm_init_userdef(Main *bmain)
   MEM_CacheLimiter_set_maximum(((size_t)U.memcachelimit) * 1024 * 1024);
   BKE_sound_init(bmain);
 
-  /* Update `U.tempdir` from user preferences. */
+  /* Update the temporary directory from the preferences or fallback to the system default. */
   BKE_tempdir_init(U.tempdir);
 
   /* Update tablet API preference. */
diff --git a/source/creator/creator.c b/source/creator/creator.c
index f7b0fa3a31f..7b279edb6b0 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -458,11 +458,6 @@ int main(int argc,
     BLI_argsParse(ba, 3, NULL, NULL);
 #endif
     WM_init(C, argc, (const char **)argv);
-
-    /* This is properly initialized with user-preferences,
-     * but this is default.
-     * Call after loading the #BLENDER_STARTUP_FILE so we can read #U.tempdir */
-    BKE_tempdir_init(U.tempdir);
   }
   else {
 #ifndef WITH_PYTHON_MODULE
@@ -470,9 +465,6 @@ int main(int argc,
 #endif
 
     WM_init(C, argc, (const char **)argv);
-
-    /* Don't use user preferences #U.tempdir */
-    BKE_tempdir_init(NULL);
   }
 #ifdef WITH_PYTHON
   /**



More information about the Bf-blender-cvs mailing list