Index: source/blender/python/api2_2x/Blender.c =================================================================== --- source/blender/python/api2_2x/Blender.c (revision 12669) +++ source/blender/python/api2_2x/Blender.c (working copy) @@ -278,7 +278,11 @@ if ( !PyArg_Parse( arg , "s" , &dir )) return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" ); BLI_strncpy(U.tempdir, dir, FILE_MAXDIR); - } else + } else if (StringEqual( name , "compressfile" ) ) { + if ( !PyArg_Parse( arg , "s" , &dir )) + return EXPP_ReturnPyObjError( PyExc_ValueError, "expected a string" ); + U.flag |= USER_FILECOMPRESS; + }else return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "value given is not a blender setting" ) ); Py_RETURN_NONE; @@ -685,10 +689,16 @@ disable_where_script( 1 ); /* to avoid error popups in the write_* functions */ - if( BLI_testextensie( fname, ".blend" ) ) { + if( BLI_testextensie( fname, ".blend" ) ) { + int writeflags; if( G.fileflags & G_AUTOPACK ) packAll( ); - if( !BLO_write_file( fname, G.fileflags, &error ) ) { + + writeflags= G.fileflags & ~G_FILE_COMPRESS; + if(U.flag & USER_FILECOMPRESS) + writeflags |= G_FILE_COMPRESS; + + if( !BLO_write_file( fname, writeflags, &error ) ) { disable_where_script( 0 ); return EXPP_ReturnPyObjError( PyExc_SystemError, error );