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,18 @@ 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" ) ) { + short value; + if( !PyInt_Check( arg ) ) + return EXPP_ReturnPyObjError( PyExc_ValueError, + "expected an integer" ); + value=(short)PyInt_AsLong( arg ); + if (value) + U.flag |= USER_FILECOMPRESS; + else + U.flag &=~ USER_FILECOMPRESS; + + }else return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "value given is not a blender setting" ) ); Py_RETURN_NONE; @@ -685,10 +696,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 );