Index: source/blender/python/api2_2x/Blender.c =================================================================== --- source/blender/python/api2_2x/Blender.c (revision 12680) +++ 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; @@ -506,6 +517,10 @@ } /* End 'quick hack' part. */ else if(StringEqual( str, "version" )) ret = PyInt_FromLong( G.version ); + + else if(StringEqual( str, "compressfile" )) + ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15 ); + else return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown attribute" ); @@ -685,10 +700,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 ); Index: source/blender/python/api2_2x/doc/Blender.py =================================================================== --- source/blender/python/api2_2x/doc/Blender.py (revision 12680) +++ source/blender/python/api2_2x/doc/Blender.py (working copy) @@ -60,6 +60,7 @@ @type request: string @param request: The setting to change: - 'curframe': the current animation frame + - 'compressfile' : compress (data=1) or not (data=0) file while recording. - 'uscriptsdir': user scripts dir - 'yfexportdir': yafray temp xml storage dir - 'fontsdir': font dir @@ -79,6 +80,7 @@ @param request: The setting data to be returned: - 'curframe': the current animation frame. - 'curtime' : the current animation time. + - 'compressfile' : compress state from the file menu, return 0 for false or 1 for true. - 'staframe': the start frame of the animation. - 'endframe': the end frame of the animation. - 'rt': the value of the 'rt' button for general debugging