diff options
author | Janne Karhu <jhkarh@gmail.com> | 2011-01-02 09:52:47 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2011-01-02 09:52:47 +0300 |
commit | a6a2512f47fb0019ea3cb68b2cb303d7933daa67 (patch) | |
tree | f57fcb4ea0291a175bbe6bb81ed1585dfd144f7b /source/blender/makesdna | |
parent | d5820f0dd03c9e049dc7613f46f82aaeab4e3f8a (diff) |
Pointcache code cleanup and disk cache compression options:
* Massive reorganization of pointcache code, things are now cleaner than ever.
* For all but smoke the cache is first written to memory when using disk cache and after that written to disk in one operation. This allows less disk operations and the possibility to compress the data before writing it to disk.
* Previously only smoke cache could be compressed, now the same options exist for other physics types too (when using disk cache). For now the default compression option is still "no compression", but if there aren't any problems this can be set to "light compression" as it's actually faster than no compression in most cases since there's less data to write to the disk. Based on quick tests heavy compression can reduce the file size down to 1/3rd of the original size, but is really slow compared to other options, so it should be used only if file size is critical!
* The pointcache code wasn't really 64bit compatible (for disk cache) until now, so this update should fix some crashes on 64bit builds too. Now all integer data that's saved to disk uses 32 bit unsigned integers, so simulations done on 64bit should load fine on 32bit machines and vice versa. (Important disk cache simulations made on 64bit builds should be converted to memory cache in a revision before this commit).
* There are also the beginnings of extradata handling code in pointcache in anticipation of adding the dynamic springs for particle fluids (the springs need to be stored as extradata into point cache).
* Particles were being read from the cache with a slightly wrong framerate. In most cases this probably wasn't noticeable, but none the less the code is now correct in every way.
* Small other fixes here and there & some cosmetic changes to cache panel, but over all there should be no functional changes other than the new disk cache compression options.
* This whole re-organization also seems to fix bug #25436 and hopefully shouldn't introduce any new ones!
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_object_force.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 8a6018fb7ea..96f2c1ccc79 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -141,6 +141,13 @@ typedef struct EffectorWeights { #define BPHYS_TOT_DATA 8 +typedef struct PTCacheExtra { + struct PTCacheExtra *next, *prev; + unsigned int type, flag; + unsigned int totdata, datasize; + void *data; +} PTCacheExtra; + typedef struct PTCacheMem { struct PTCacheMem *next, *prev; int frame, totpoint; @@ -149,6 +156,8 @@ typedef struct PTCacheMem { void *data[8]; /* BPHYS_TOT_DATA */ void *cur[8]; /* BPHYS_TOT_DATA */ + + struct ListBase extradata; } PTCacheMem; typedef struct PointCache { @@ -175,7 +184,8 @@ typedef struct PointCache { /* for external cache files */ int totpoint; /* number of cached points */ - int index, rt; /* modifier stack index */ + int index; /* modifier stack index */ + short compression, rt; char name[64]; char prev_name[64]; @@ -387,6 +397,10 @@ typedef struct SoftBody { /* PTCACHE_OUTDATED + PTCACHE_FRAMES_SKIPPED */ #define PTCACHE_REDO_NEEDED 258 +#define PTCACHE_COMPRESS_NO 0 +#define PTCACHE_COMPRESS_LZO 1 +#define PTCACHE_COMPRESS_LZMA 2 + /* ob->softflag */ #define OB_SB_ENABLE 1 /* deprecated, use modifier */ #define OB_SB_GOAL 2 |