Blender Git Loki

Git Commits -> Revision b221c0e

Revision b221c0e by Janne Karhu (master)
August 12, 2009, 09:54 (GMT)
New point cache file format:
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags

- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData

Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.

Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.

Commit Details:

Full Hash: b221c0e2e6f390f3ed810b7f520b0ad60511ba36
SVN Revision: 22396
Parent Commit: 8641833
Lines Changed: +1437, -1052

21 Modified Paths:

/release/ui/buttons_particle.py (+22, -14) (Diff)
/release/ui/buttons_physics_cloth.py (+12, -5) (Diff)
/release/ui/buttons_physics_softbody.py (+12, -5) (Diff)
/source/blender/blenkernel/BKE_cloth.h (+0, -4) (Diff)
/source/blender/blenkernel/BKE_pointcache.h (+46, -31) (Diff)
/source/blender/blenkernel/BKE_softbody.h (+0, -3) (Diff)
/source/blender/blenkernel/intern/cloth.c (+4, -91) (Diff)
/source/blender/blenkernel/intern/modifier.c (+7, -5) (Diff)
/source/blender/blenkernel/intern/particle.c (+7, -7) (Diff)
/source/blender/blenkernel/intern/particle_system.c (+11, -126) (Diff)
/source/blender/blenkernel/intern/pointcache.c (+1021, -389) (Diff)
/source/blender/blenkernel/intern/softbody.c (+7, -88) (Diff)
/source/blender/blenloader/intern/readfile.c (+47, -16) (Diff)
/source/blender/blenloader/intern/writefile.c (+22, -13) (Diff)
/source/blender/editors/mesh/editmesh.c (+6, -10) (Diff)
/source/blender/editors/physics/ed_pointcache.c (+90, -242) (Diff)
/source/blender/makesdna/DNA_modifier_types.h (+1, -0) (Diff)
/source/blender/makesdna/DNA_object_force.h (+26, -2) (Diff)
/source/blender/makesdna/DNA_particle_types.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_fluidsim.c (+1, -1) (Diff)
/source/blender/makesrna/intern/rna_object_force.c (+94, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021