Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback.
'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#define BPY_EXTERN_H
|
||||
|
||||
extern char bprogname[]; /* holds a copy of argv[0], from creator.c */
|
||||
extern char btempdir[]; /* use this to store a valid temp directory */
|
||||
|
||||
struct Text; /* defined in DNA_text_types.h */
|
||||
struct ID; /* DNA_ID.h */
|
||||
|
||||
@@ -286,6 +286,7 @@ static PyObject *Blender_Set( PyObject * self, PyObject * args )
|
||||
if ( !PyArg_Parse( arg , "s" , &dir ))
|
||||
return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" );
|
||||
BLI_strncpy(U.tempdir, dir, FILE_MAXDIR);
|
||||
BLI_where_is_temp( btempdir, 1 );
|
||||
} else if (StringEqual( name , "compressfile" ) ) {
|
||||
int value = PyObject_IsTrue( arg );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user