Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

BKE_pointcache.h File Reference

#include "DNA_ID.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_object_force.h"
#include "DNA_boid_types.h"
#include <stdio.h>

Go to the source code of this file.

Classes

struct  PTCacheData
struct  PTCacheFile
struct  PTCacheID
struct  PTCacheBaker
struct  PTCacheEditKey
struct  PTCacheEditPoint
struct  PTCacheUndo
struct  PTCacheEdit

Defines

#define PTCACHE_CLEAR_ALL   0
#define PTCACHE_CLEAR_FRAME   1
#define PTCACHE_CLEAR_BEFORE   2
#define PTCACHE_CLEAR_AFTER   3
#define PTCACHE_RESET_DEPSGRAPH   0
#define PTCACHE_RESET_BAKED   1
#define PTCACHE_RESET_OUTDATED   2
#define PTCACHE_EXT   ".bphys"
#define PTCACHE_PATH   "blendcache_"
#define PTCACHE_FILE_READ   0
#define PTCACHE_FILE_WRITE   1
#define PTCACHE_FILE_UPDATE   2
#define PTCACHE_TYPE_SOFTBODY   0
#define PTCACHE_TYPE_PARTICLES   1
#define PTCACHE_TYPE_CLOTH   2
#define PTCACHE_TYPE_SMOKE_DOMAIN   3
#define PTCACHE_TYPE_SMOKE_HIGHRES   4
#define PTCACHE_TYPE_DYNAMICPAINT   5
#define PTCACHE_TYPEFLAG_COMPRESS   (1<<16)
#define PTCACHE_TYPEFLAG_EXTRADATA   (1<<17)
#define PTCACHE_TYPEFLAG_TYPEMASK   0x0000FFFF
#define PTCACHE_TYPEFLAG_FLAGMASK   0xFFFF0000
#define PTCACHE_READ_EXACT   1
#define PTCACHE_READ_INTERPOLATED   2
#define PTCACHE_READ_OLD   3
#define PTCACHE_VEL_PER_SEC   1
#define PEK_SELECT   1
#define PEK_TAG   2
#define PEK_HIDE   4
#define PEK_USE_WCO   8
#define PEP_TAG   1
#define PEP_EDIT_RECALC   2
#define PEP_TRANSFORM   4
#define PEP_HIDE   8

Typedefs

typedef struct PTCacheData PTCacheData
typedef struct PTCacheFile PTCacheFile
typedef struct PTCacheID PTCacheID
typedef struct PTCacheBaker PTCacheBaker
typedef struct PTCacheEditKey PTCacheEditKey
typedef struct PTCacheEditPoint PTCacheEditPoint
typedef struct PTCacheUndo PTCacheUndo
typedef struct PTCacheEdit PTCacheEdit

Functions

void BKE_ptcache_make_particle_key (struct ParticleKey *key, int index, void **data, float time)
void BKE_ptcache_id_from_softbody (PTCacheID *pid, struct Object *ob, struct SoftBody *sb)
void BKE_ptcache_id_from_particles (PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys)
void BKE_ptcache_id_from_cloth (PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd)
void BKE_ptcache_id_from_smoke (PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd)
void BKE_ptcache_id_from_dynamicpaint (PTCacheID *pid, struct Object *ob, struct DynamicPaintSurface *surface)
void BKE_ptcache_ids_from_object (struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis)
void BKE_ptcache_remove (void)
void BKE_ptcache_id_clear (PTCacheID *id, int mode, unsigned int cfra)
int BKE_ptcache_id_exist (PTCacheID *id, int cfra)
int BKE_ptcache_id_reset (struct Scene *scene, PTCacheID *id, int mode)
void BKE_ptcache_id_time (PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
int BKE_ptcache_object_reset (struct Scene *scene, struct Object *ob, int mode)
void BKE_ptcache_update_info (PTCacheID *pid)
int BKE_ptcache_data_size (int data_type)
int BKE_ptcache_mem_index_find (struct PTCacheMem *pm, unsigned int index)
void BKE_ptcache_mem_pointers_init (struct PTCacheMem *pm)
void BKE_ptcache_mem_pointers_incr (struct PTCacheMem *pm)
int BKE_ptcache_mem_pointers_seek (int point_index, struct PTCacheMem *pm)
void BKE_ptcache_data_get (void **data, int type, int index, void *to)
void BKE_ptcache_data_set (void **data, int type, void *from)
int BKE_ptcache_read (PTCacheID *pid, float cfra)
int BKE_ptcache_write (PTCacheID *pid, unsigned int cfra)
void BKE_ptcache_set_continue_physics (struct Main *bmain, struct Scene *scene, int enable)
int BKE_ptcache_get_continue_physics (void)
struct PointCacheBKE_ptcache_add (struct ListBase *ptcaches)
void BKE_ptcache_free_mem (struct ListBase *mem_cache)
void BKE_ptcache_free (struct PointCache *cache)
void BKE_ptcache_free_list (struct ListBase *ptcaches)
struct PointCacheBKE_ptcache_copy_list (struct ListBase *ptcaches_new, struct ListBase *ptcaches_old)
void BKE_ptcache_quick_cache_all (struct Main *bmain, struct Scene *scene)
void BKE_ptcache_bake (struct PTCacheBaker *baker)
void BKE_ptcache_disk_to_mem (struct PTCacheID *pid)
void BKE_ptcache_mem_to_disk (struct PTCacheID *pid)
void BKE_ptcache_toggle_disk_cache (struct PTCacheID *pid)
void BKE_ptcache_disk_cache_rename (struct PTCacheID *pid, const char *name_src, const char *name_dst)
void BKE_ptcache_load_external (struct PTCacheID *pid)
void BKE_ptcache_validate (struct PointCache *cache, int framenr)
void BKE_ptcache_invalidate (struct PointCache *cache)

Detailed Description

Definition in file BKE_pointcache.h.


Define Documentation

#define PEK_HIDE   4

Definition at line 187 of file BKE_pointcache.h.

Referenced by brush_puff(), createTransParticleVerts(), and PE_hide_keys_time().

#define PEK_SELECT   1
#define PEK_TAG   2
#define PEK_USE_WCO   8
#define PEP_EDIT_RECALC   2
#define PEP_HIDE   8
#define PEP_TAG   1
#define PEP_TRANSFORM   4

Definition at line 205 of file BKE_pointcache.h.

Referenced by createTransParticleVerts(), and flushTransParticles().

#define PTCACHE_CLEAR_AFTER   3
#define PTCACHE_CLEAR_ALL   0
#define PTCACHE_CLEAR_BEFORE   2

Definition at line 45 of file BKE_pointcache.h.

Referenced by BKE_ptcache_id_clear().

#define PTCACHE_CLEAR_FRAME   1
#define PTCACHE_EXT   ".bphys"
#define PTCACHE_FILE_READ   0
#define PTCACHE_FILE_UPDATE   2

Definition at line 61 of file BKE_pointcache.h.

Referenced by ptcache_file_open().

#define PTCACHE_FILE_WRITE   1
#define PTCACHE_PATH   "blendcache_"

Definition at line 56 of file BKE_pointcache.h.

Referenced by ptcache_path().

#define PTCACHE_READ_EXACT   1

Definition at line 79 of file BKE_pointcache.h.

Referenced by BKE_ptcache_read(), clothModifier_do(), sbObjectStep(), and system_step().

#define PTCACHE_READ_INTERPOLATED   2

Definition at line 80 of file BKE_pointcache.h.

Referenced by BKE_ptcache_read(), clothModifier_do(), sbObjectStep(), and system_step().

#define PTCACHE_READ_OLD   3

Definition at line 81 of file BKE_pointcache.h.

Referenced by BKE_ptcache_read(), clothModifier_do(), sbObjectStep(), and system_step().

#define PTCACHE_RESET_BAKED   1

Definition at line 50 of file BKE_pointcache.h.

Referenced by BKE_ptcache_id_reset().

#define PTCACHE_RESET_DEPSGRAPH   0
#define PTCACHE_RESET_OUTDATED   2
#define PTCACHE_TYPE_CLOTH   2
#define PTCACHE_TYPE_DYNAMICPAINT   5
#define PTCACHE_TYPE_PARTICLES   1
#define PTCACHE_TYPE_SMOKE_DOMAIN   3
#define PTCACHE_TYPE_SMOKE_HIGHRES   4

Definition at line 68 of file BKE_pointcache.h.

Referenced by BKE_ptcache_bake(), BKE_ptcache_id_reset(), and time_draw_cache().

#define PTCACHE_TYPE_SOFTBODY   0
#define PTCACHE_TYPEFLAG_COMPRESS   (1<<16)

Definition at line 72 of file BKE_pointcache.h.

Referenced by ptcache_disk_frame_to_mem(), and ptcache_mem_frame_to_disk().

#define PTCACHE_TYPEFLAG_EXTRADATA   (1<<17)

Definition at line 73 of file BKE_pointcache.h.

Referenced by ptcache_disk_frame_to_mem(), and ptcache_mem_frame_to_disk().

#define PTCACHE_TYPEFLAG_FLAGMASK   0xFFFF0000

Definition at line 76 of file BKE_pointcache.h.

Referenced by ptcache_file_header_begin_read().

#define PTCACHE_TYPEFLAG_TYPEMASK   0x0000FFFF

Definition at line 75 of file BKE_pointcache.h.

Referenced by ptcache_file_header_begin_read().

#define PTCACHE_VEL_PER_SEC   1

Definition at line 118 of file BKE_pointcache.h.

Referenced by BKE_ptcache_id_from_particles(), and update_velocities().


Typedef Documentation

typedef struct PTCacheBaker PTCacheBaker
typedef struct PTCacheData PTCacheData
typedef struct PTCacheEdit PTCacheEdit
typedef struct PTCacheFile PTCacheFile
typedef struct PTCacheID PTCacheID
typedef struct PTCacheUndo PTCacheUndo

Function Documentation

struct PointCache* BKE_ptcache_add ( struct ListBase ptcaches) [read]
void BKE_ptcache_bake ( struct PTCacheBaker baker)

Definition at line 2758 of file pointcache.c.

References PTCacheBaker::anim_init, PTCacheBaker::bake, BKE_ptcache_id_clear(), BKE_ptcache_ids_from_object(), BKE_ptcache_write(), blender_test_break(), BLI_end_threads(), BLI_freelistN(), BLI_init_threads(), BLI_insert_thread(), ptcache_bake_data::break_operation, PTCacheID::cache, PTCacheID::calldata, CFRA, ptcache_bake_data::cfra_ptr, PointCache::endframe, ptcache_bake_data::endframe, FALSE, ListBase::first, PointCache::flag, RenderData::framelen, G, PointCache::last_exact, Scene::lay, ptcache_bake_data::main, PTCacheBaker::main, MAX2, MAX_DUPLI_RECUR, MAXFRAME, MIN2, PTCacheID::next, NULL, PTCacheID::ob, Base::object, ParticleSystem::part, PART_EMITTER, PART_HAIR, PART_PHYS_KEYED, ParticleSettings::phystype, PTCacheBaker::pid, PIL_sleep_ms(), PTCacheBaker::progressbar, PTCacheBaker::progresscontext, PTCacheBaker::progressend, psys_get_pointcache_start_end(), ptcache_bake_thread(), PTCACHE_BAKED, PTCACHE_BAKING, PTCACHE_CLEAR_ALL, PTCACHE_DISK_CACHE, PTCACHE_OUTDATED, PTCACHE_QUICK_CACHE, PTCACHE_REDO_NEEDED, PTCACHE_SIMULATION_VALID, PTCACHE_TYPE_PARTICLES, PTCACHE_TYPE_SMOKE_DOMAIN, PTCACHE_TYPE_SMOKE_HIGHRES, PTCacheBaker::quick_step, Scene::r, PTCacheBaker::render, addon::engine::render(), ptcache_bake_data::scene, PTCacheBaker::scene, scene_update_for_newframe(), SETLOOPER, RenderData::sfra, PointCache::startframe, ptcache_bake_data::step, ptcache_bake_data::thread_ended, threads, TRUE, ParticleSettings::type, PTCacheID::type, and WM_cursor_wait().

Referenced by BKE_ptcache_quick_cache_all(), ptcache_bake_all_exec(), ptcache_bake_exec(), and update_physics_cache().

struct PointCache* BKE_ptcache_copy_list ( struct ListBase ptcaches_new,
struct ListBase ptcaches_old 
) [read]
void BKE_ptcache_data_get ( void **  data,
int  type,
int  index,
void *  to 
)
void BKE_ptcache_data_set ( void **  data,
int  type,
void *  from 
)
int BKE_ptcache_data_size ( int  data_type)

Definition at line 1346 of file pointcache.c.

References ptcache_data_size.

Referenced by direct_link_pointcache().

void BKE_ptcache_disk_cache_rename ( struct PTCacheID pid,
const char *  name_src,
const char *  name_dst 
)
void BKE_ptcache_disk_to_mem ( struct PTCacheID pid)
void BKE_ptcache_free ( struct PointCache cache)
void BKE_ptcache_free_list ( struct ListBase ptcaches)
void BKE_ptcache_free_mem ( struct ListBase mem_cache)
int BKE_ptcache_get_continue_physics ( void  )
void BKE_ptcache_id_clear ( PTCacheID id,
int  mode,
unsigned int  cfra 
)
int BKE_ptcache_id_exist ( PTCacheID id,
int  cfra 
)
void BKE_ptcache_id_from_cloth ( PTCacheID pid,
struct Object ob,
struct ClothModifierData clmd 
)
void BKE_ptcache_id_from_dynamicpaint ( PTCacheID pid,
struct Object ob,
struct DynamicPaintSurface surface 
)
void BKE_ptcache_id_from_particles ( PTCacheID pid,
struct Object ob,
struct ParticleSystem psys 
)

Definition at line 777 of file pointcache.c.

References ParticleSettings::avefac, ParticleSettings::avemode, BPHYS_DATA_AVELOCITY, BPHYS_DATA_BOIDS, BPHYS_DATA_INDEX, BPHYS_DATA_LOCATION, BPHYS_DATA_ROTATION, BPHYS_DATA_TIMES, BPHYS_DATA_VELOCITY, PTCacheID::cache, PTCacheID::cache_ptr, PTCacheID::calldata, PTCacheID::data_types, PTCacheID::default_step, ParticleSettings::flag, SPHFluidSettings::flag, PTCacheID::flag, ParticleSettings::fluid, PointCache::index, PTCacheID::info_types, PTCacheID::interpolate_extra_data, PTCacheID::interpolate_point, PTCacheID::max_step, NULL, PTCacheID::ob, ParticleSystem::part, PART_AVE_SPIN, PART_HAIR, PART_PHYS_BOIDS, PART_PHYS_FLUID, PART_ROT_DYN, PART_ROT_VEL, ParticleSettings::phystype, ParticleSystem::pointcache, ptcache_basic_header_read(), ptcache_basic_header_write(), ptcache_particle_extra_read(), ptcache_particle_extra_write(), ptcache_particle_interpolate(), ptcache_particle_read(), ptcache_particle_totpoint(), ptcache_particle_totwrite(), ptcache_particle_write(), PTCACHE_TYPE_PARTICLES, PTCACHE_VEL_PER_SEC, ParticleSystem::ptcaches, PTCacheID::ptcaches, PTCacheID::read_extra_data, PTCacheID::read_header, PTCacheID::read_point, PTCacheID::read_stream, ParticleSettings::rotmode, SPH_VISCOELASTIC_SPRINGS, PTCacheID::stack_index, PTCacheID::totpoint, PTCacheID::totwrite, ParticleSettings::type, PTCacheID::type, PTCacheID::write_extra_data, PTCacheID::write_header, PTCacheID::write_point, and PTCacheID::write_stream.

Referenced by BKE_ptcache_ids_from_object(), BKE_ptcache_object_reset(), psys_changed_type(), psys_make_temp_pointcache(), psys_prepare_physics(), and system_step().

void BKE_ptcache_id_from_smoke ( PTCacheID pid,
struct Object ob,
struct SmokeModifierData smd 
)
void BKE_ptcache_id_from_softbody ( PTCacheID pid,
struct Object ob,
struct SoftBody sb 
)
int BKE_ptcache_id_reset ( struct Scene scene,
PTCacheID id,
int  mode 
)
void BKE_ptcache_id_time ( PTCacheID pid,
struct Scene scene,
float  cfra,
int *  startframe,
int *  endframe,
float *  timescale 
)
void BKE_ptcache_ids_from_object ( struct ListBase lb,
struct Object ob,
struct Scene scene,
int  duplis 
)
void BKE_ptcache_invalidate ( struct PointCache cache)
void BKE_ptcache_load_external ( struct PTCacheID pid)
void BKE_ptcache_make_particle_key ( struct ParticleKey key,
int  index,
void **  data,
float  time 
)
int BKE_ptcache_mem_index_find ( struct PTCacheMem pm,
unsigned int  index 
)
void BKE_ptcache_mem_pointers_incr ( struct PTCacheMem pm)
void BKE_ptcache_mem_pointers_init ( struct PTCacheMem pm)
int BKE_ptcache_mem_pointers_seek ( int  point_index,
struct PTCacheMem pm 
)
void BKE_ptcache_mem_to_disk ( struct PTCacheID pid)
int BKE_ptcache_object_reset ( struct Scene scene,
struct Object ob,
int  mode 
)
void BKE_ptcache_quick_cache_all ( struct Main bmain,
struct Scene scene 
)
int BKE_ptcache_read ( PTCacheID pid,
float  cfra 
)
void BKE_ptcache_remove ( void  )
void BKE_ptcache_set_continue_physics ( struct Main bmain,
struct Scene scene,
int  enable 
)
void BKE_ptcache_toggle_disk_cache ( struct PTCacheID pid)
void BKE_ptcache_update_info ( PTCacheID pid)
void BKE_ptcache_validate ( struct PointCache cache,
int  framenr 
)
int BKE_ptcache_write ( PTCacheID pid,
unsigned int  cfra 
)