Blender V5.0
pointcache.cc File Reference
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_fluid_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_force_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "BLI_compression.hh"
#include "BLI_fileops.h"
#include "BLI_listbase.h"
#include "BLI_math_rotation.h"
#include "BLI_math_vector.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"
#include "BLI_time.h"
#include "BLI_utildefines.h"
#include "BLT_translation.hh"
#include "BKE_appdir.hh"
#include "BKE_cloth.hh"
#include "BKE_collection.hh"
#include "BKE_duplilist.hh"
#include "BKE_dynamicpaint.h"
#include "BKE_fluid.h"
#include "BKE_global.hh"
#include "BKE_lib_id.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_modifier.hh"
#include "BKE_object.hh"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_scene.hh"
#include "BKE_softbody.h"
#include "BLO_read_write.hh"
#include "DEG_depsgraph_query.hh"
#include "BIK_api.h"
#include <zstd.h>

Go to the source code of this file.

Macros

#define PTCACHE_DATA_FROM(data, type, from)
#define PTCACHE_DATA_TO(data, type, index, to)
#define DURIAN_POINTCACHE_LIB_OK   1
#define DPAINT_CACHE_VERSION   "1.01"
#define MAX_PTCACHE_PATH   FILE_MAX
#define MAX_PTCACHE_FILE   (FILE_MAX * 2)

Functions

static int ptcache_file_compressed_read (PTCacheFile *pf, uchar *result, uint items_num, uint item_size)
static void ptcache_file_compressed_write (PTCacheFile *pf, const void *data, uint items_num, uint item_size)
static int ptcache_file_write (PTCacheFile *pf, const void *data, uint items_num, uint item_size)
static bool ptcache_file_read (PTCacheFile *pf, void *f, uint items_num, uint item_size)
static int ptcache_basic_header_read (PTCacheFile *pf)
static int ptcache_basic_header_write (PTCacheFile *pf)
static void ptcache_add_extra_data (PTCacheMem *pm, uint type, uint count, void *data)
static int ptcache_softbody_write (int index, void *soft_v, void **data, int)
static void ptcache_softbody_read (int index, void *soft_v, void **data, float, const float *old_data)
static void ptcache_softbody_interpolate (int index, void *soft_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static int ptcache_softbody_totpoint (void *soft_v, int)
static void ptcache_softbody_error (const ID *, void *, const char *)
void BKE_ptcache_make_particle_key (ParticleKey *key, int index, void **data, float time)
static int ptcache_particle_write (int index, void *psys_v, void **data, int cfra)
static void ptcache_particle_read (int index, void *psys_v, void **data, float cfra, const float *old_data)
static void ptcache_particle_interpolate (int index, void *psys_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static int ptcache_particle_totpoint (void *psys_v, int)
static void ptcache_particle_error (const ID *, void *, const char *)
static int ptcache_particle_totwrite (void *psys_v, int cfra)
static void ptcache_particle_extra_write (void *psys_v, PTCacheMem *pm, int)
static void ptcache_particle_extra_read (void *psys_v, PTCacheMem *pm, float)
static int ptcache_cloth_write (int index, void *cloth_v, void **data, int)
static void ptcache_cloth_read (int index, void *cloth_v, void **data, float, const float *old_data)
static void ptcache_cloth_interpolate (int index, void *cloth_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static void ptcache_cloth_extra_write (void *cloth_v, PTCacheMem *pm, int)
static void ptcache_cloth_extra_read (void *cloth_v, PTCacheMem *pm, float)
static int ptcache_cloth_totpoint (void *cloth_v, int)
static void ptcache_cloth_error (const ID *owner_id, void *cloth_v, const char *message)
static int ptcache_dynamicpaint_totpoint (void *sd, int)
static void ptcache_dynamicpaint_error (const ID *, void *, const char *)
static int ptcache_dynamicpaint_write (PTCacheFile *pf, void *dp_v)
static int ptcache_dynamicpaint_read (PTCacheFile *pf, void *dp_v)
static int ptcache_rigidbody_write (int index, void *rb_v, void **data, int)
static void ptcache_rigidbody_read (int index, void *rb_v, void **data, float, const float *old_data)
static void ptcache_rigidbody_interpolate (int index, void *rb_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static int ptcache_rigidbody_totpoint (void *rb_v, int)
static void ptcache_rigidbody_error (const ID *, void *, const char *)
void BKE_ptcache_id_from_softbody (PTCacheID *pid, Object *ob, SoftBody *sb)
void BKE_ptcache_id_from_particles (PTCacheID *pid, Object *ob, ParticleSystem *psys)
void BKE_ptcache_id_from_cloth (PTCacheID *pid, Object *ob, ClothModifierData *clmd)
void BKE_ptcache_id_from_smoke (PTCacheID *pid, Object *ob, FluidModifierData *fmd)
void BKE_ptcache_id_from_dynamicpaint (PTCacheID *pid, Object *ob, DynamicPaintSurface *surface)
void BKE_ptcache_id_from_rigidbody (PTCacheID *pid, Object *ob, RigidBodyWorld *rbw)
PTCacheID BKE_ptcache_id_find (Object *ob, Scene *scene, PointCache *cache)
static bool foreach_object_particle_ptcache (Object *object, PointCacheIdFn callback)
static bool foreach_object_modifier_ptcache (Object *object, PointCacheIdFn callback)
static bool foreach_object_ptcache (Scene *scene, Object *object, int duplis, PointCacheIdFn callback)
void BKE_ptcache_ids_from_object (ListBase *lb, Object *ob, Scene *scene, int duplis)
void BKE_ptcache_foreach_object_cache (Object &ob, Scene &scene, bool duplis, PointCacheIdFn fn)
bool BKE_ptcache_object_has (Scene *scene, Object *ob, int duplis)
static const char * ptcache_file_extension (const PTCacheID *pid)
static int ptcache_frame_from_filename (const char *filename, const char *ext)
static int ptcache_path (PTCacheID *pid, char dirname[MAX_PTCACHE_PATH])
static size_t ptcache_filepath_ext_append (PTCacheID *pid, char filepath[MAX_PTCACHE_FILE], const size_t filepath_len, const bool use_frame_number, const int cfra)
static int ptcache_filepath (PTCacheID *pid, char filepath[MAX_PTCACHE_FILE], int cfra, const bool do_path, const bool do_ext)
static PTCacheFileptcache_file_open (PTCacheID *pid, int mode, int cfra)
static void ptcache_file_close (PTCacheFile *pf)
static bool ptcache_file_data_read (PTCacheFile *pf)
static int ptcache_file_header_begin_read (PTCacheFile *pf)
static int ptcache_file_header_begin_write (PTCacheFile *pf)
int BKE_ptcache_data_size (int data_type)
static void ptcache_file_pointers_init (PTCacheFile *pf)
int BKE_ptcache_mem_index_find (PTCacheMem *pm, uint index)
void BKE_ptcache_mem_pointers_init (PTCacheMem *pm, void *cur[BPHYS_TOT_DATA])
void BKE_ptcache_mem_pointers_incr (void *cur[BPHYS_TOT_DATA])
int BKE_ptcache_mem_pointers_seek (int point_index, PTCacheMem *pm, void *cur[BPHYS_TOT_DATA])
static void ptcache_data_alloc (PTCacheMem *pm)
static void ptcache_data_free (PTCacheMem *pm)
static void ptcache_data_copy (void *from[], void *to[])
static void ptcache_extra_free (PTCacheMem *pm)
static void ptcache_mem_clear (PTCacheMem *pm)
static int ptcache_old_elemsize (PTCacheID *pid)
static void ptcache_find_frames_around (PTCacheID *pid, uint frame, int *r_fra1, int *r_fra2)
static PTCacheMemptcache_disk_frame_to_mem (PTCacheID *pid, int cfra)
static int ptcache_mem_frame_to_disk (PTCacheID *pid, PTCacheMem *pm)
static int ptcache_read_stream (PTCacheID *pid, int cfra)
static int ptcache_read (PTCacheID *pid, int cfra)
static int ptcache_interpolate (PTCacheID *pid, float cfra, int cfra1, int cfra2)
int BKE_ptcache_read (PTCacheID *pid, float cfra, bool no_extrapolate_old)
static int ptcache_write_stream (PTCacheID *pid, int cfra, int totpoint)
static int ptcache_write (PTCacheID *pid, int cfra, int overwrite)
static int ptcache_write_needed (PTCacheID *pid, int cfra, int *overwrite)
int BKE_ptcache_write (PTCacheID *pid, uint cfra)
void BKE_ptcache_id_clear (PTCacheID *pid, int mode, uint cfra)
bool BKE_ptcache_id_exist (PTCacheID *pid, int cfra)
void BKE_ptcache_id_time (PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
int BKE_ptcache_id_reset (Scene *scene, PTCacheID *pid, int mode)
int BKE_ptcache_object_reset (Scene *scene, Object *ob, int mode)
PointCacheBKE_ptcache_add (ListBase *ptcaches)
void BKE_ptcache_free_mem (ListBase *mem_cache)
void BKE_ptcache_free (PointCache *cache)
void BKE_ptcache_free_list (ListBase *ptcaches)
static PointCacheptcache_copy (PointCache *cache, const bool copy_data)
PointCacheBKE_ptcache_copy_list (ListBase *ptcaches_new, const ListBase *ptcaches_old, const int flag)
void BKE_ptcache_quick_cache_all (Main *bmain, Scene *scene, ViewLayer *view_layer)
static void ptcache_dt_to_str (char *str, size_t str_maxncpy, double dtime)
void BKE_ptcache_bake (PTCacheBaker *baker)
void BKE_ptcache_disk_to_mem (PTCacheID *pid)
void BKE_ptcache_mem_to_disk (PTCacheID *pid)
void BKE_ptcache_toggle_disk_cache (PTCacheID *pid)
void BKE_ptcache_disk_cache_rename (PTCacheID *pid, const char *name_src, const char *name_dst)
void BKE_ptcache_load_external (PTCacheID *pid)
void BKE_ptcache_update_info (PTCacheID *pid)
void BKE_ptcache_validate (PointCache *cache, int framenr)
void BKE_ptcache_invalidate (PointCache *cache)
void BKE_ptcache_blend_write (BlendWriter *writer, ListBase *ptcaches)
static void direct_link_pointcache_mem (BlendDataReader *reader, PTCacheMem *pm)
static void direct_link_pointcache (BlendDataReader *reader, PointCache *cache)
void BKE_ptcache_blend_read_data (BlendDataReader *reader, ListBase *ptcaches, PointCache **ocache, int force_disk)

Variables

static CLG_LogRef LOG = {"physics.pointcache"}
static int ptcache_data_size []
static int ptcache_extra_datasize []

Macro Definition Documentation

◆ DPAINT_CACHE_VERSION

#define DPAINT_CACHE_VERSION   "1.01"

Definition at line 671 of file pointcache.cc.

Referenced by ptcache_dynamicpaint_read(), and ptcache_dynamicpaint_write().

◆ DURIAN_POINTCACHE_LIB_OK

#define DURIAN_POINTCACHE_LIB_OK   1

Definition at line 95 of file pointcache.cc.

◆ MAX_PTCACHE_FILE

◆ MAX_PTCACHE_PATH

◆ PTCACHE_DATA_FROM

#define PTCACHE_DATA_FROM ( data,
type,
from )
Value:
if (data[type]) { \
memcpy(data[type], from, ptcache_data_size[type]); \
} \
(void)0
BMesh const char void * data
static int ptcache_data_size[]
Definition pointcache.cc:99

Definition at line 80 of file pointcache.cc.

Referenced by ptcache_cloth_write(), ptcache_particle_write(), ptcache_rigidbody_write(), and ptcache_softbody_write().

◆ PTCACHE_DATA_TO

#define PTCACHE_DATA_TO ( data,
type,
index,
to )
Value:
if (data[type]) { \
memcpy(to, \
(char *)(data)[type] + ((index) ? (index) * ptcache_data_size[type] : 0), \
} \
(void)0

Definition at line 86 of file pointcache.cc.

Referenced by BKE_ptcache_make_particle_key(), ptcache_cloth_read(), ptcache_particle_read(), ptcache_rigidbody_interpolate(), ptcache_rigidbody_read(), and ptcache_softbody_read().

Function Documentation

◆ BKE_ptcache_add()

◆ BKE_ptcache_bake()

void BKE_ptcache_bake ( struct PTCacheBaker * baker)

Bake cache or simulate to current frame with settings defined in the baker. if bake is not given run simulations to current frame.

Definition at line 3075 of file pointcache.cc.

References PTCacheBaker::anim_init, PTCacheBaker::bake, PTCacheBaker::bake_job, BKE_ptcache_id_clear(), BKE_ptcache_id_from_particles(), BKE_ptcache_ids_from_object(), BKE_ptcache_write(), BKE_scene_graph_update_for_newframe(), BLI_assert, BLI_freelistN(), BLI_time_now_seconds(), PTCacheID::cache, PTCacheID::calldata, RenderData::cfra, DEG_get_evaluated(), depsgraph, PTCacheBaker::depsgraph, PointCache::endframe, ListBase::first, PointCache::flag, float, RenderData::framelen, G, GS, ID_OB, PointCache::last_exact, LISTBASE_FOREACH, MAX_DUPLI_RECUR, MAXFRAME, ID::name, PTCacheID::next, Base::object, PTCacheID::owner_id, ParticleSystem::part, PART_EMITTER, PART_HAIR, PART_PHYS_KEYED, ParticleSettings::phystype, PTCacheBaker::pid, printf, psys_eval_get(), psys_get_pointcache_start_end(), PTCACHE_BAKED, PTCACHE_BAKING, PTCACHE_CLEAR_ALL, PTCACHE_DISK_CACHE, ptcache_dt_to_str(), PTCACHE_OUTDATED, PTCACHE_REDO_NEEDED, PTCACHE_SIMULATION_VALID, PTCACHE_TYPE_PARTICLES, PTCACHE_TYPE_RIGIDBODY, PTCACHE_TYPE_SMOKE_DOMAIN, PTCACHE_TYPE_SMOKE_HIGHRES, PTCacheBaker::quick_step, Scene::r, PTCacheBaker::render, PTCacheBaker::scene, SETLOOPER_VIEW_LAYER, RenderData::sfra, PointCache::startframe, ParticleSettings::type, PTCacheID::type, PTCacheBaker::update_progress, and PTCacheBaker::view_layer.

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

◆ BKE_ptcache_blend_read_data()

◆ BKE_ptcache_blend_write()

◆ BKE_ptcache_copy_list()

PointCache * BKE_ptcache_copy_list ( ListBase * ptcaches_new,
const ListBase * ptcaches_old,
const int flag )

◆ BKE_ptcache_data_size()

int BKE_ptcache_data_size ( int data_type)

Size of cache data type.

Definition at line 1649 of file pointcache.cc.

References ptcache_data_size.

Referenced by BKE_ptcache_blend_write(), and direct_link_pointcache_mem().

◆ BKE_ptcache_disk_cache_rename()

void BKE_ptcache_disk_cache_rename ( struct PTCacheID * pid,
const char * name_src,
const char * name_dst )

◆ BKE_ptcache_disk_to_mem()

◆ BKE_ptcache_foreach_object_cache()

void BKE_ptcache_foreach_object_cache ( Object & ob,
Scene & scene,
bool duplis,
PointCacheIdFn fn )

◆ BKE_ptcache_free()

◆ BKE_ptcache_free_list()

◆ BKE_ptcache_free_mem()

◆ BKE_ptcache_id_clear()

◆ BKE_ptcache_id_exist()

◆ BKE_ptcache_id_find()

PTCacheID BKE_ptcache_id_find ( struct Object * ob,
struct Scene * scene,
struct PointCache * cache )
Parameters
obOptional, may be NULL.
sceneOptional may be NULL.

Definition at line 1087 of file pointcache.cc.

References BKE_ptcache_ids_from_object(), BLI_freelistN(), LISTBASE_FOREACH, MAX_DUPLI_RECUR, and result.

Referenced by ptcache_add_new_exec(), ptcache_baker_create(), and ptcache_remove_exec().

◆ BKE_ptcache_id_from_cloth()

◆ BKE_ptcache_id_from_dynamicpaint()

◆ BKE_ptcache_id_from_particles()

void BKE_ptcache_id_from_particles ( PTCacheID * pid,
Object * ob,
ParticleSystem * psys )

Definition at line 893 of file pointcache.cc.

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, PTCacheID::error, PTCacheID::file_type, ParticleSettings::flag, PTCacheID::flag, SPHFluidSettings::flag, ParticleSettings::fluid, Object::id, PointCache::index, PTCacheID::info_types, PTCacheID::interpolate_extra_data, PTCacheID::interpolate_point, PTCacheID::max_step, PTCacheID::owner_id, ParticleSystem::part, PART_AVE_RAND, PART_HAIR, PART_PHYS_BOIDS, PART_PHYS_FLUID, PART_ROT_VEL, PART_ROTATIONS, ParticleSettings::phystype, ParticleSystem::pointcache, ptcache_basic_header_read(), ptcache_basic_header_write(), PTCACHE_FILE_PTCACHE, ptcache_particle_error(), 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_bake(), BKE_ptcache_object_reset(), foreach_object_particle_ptcache(), free_hair(), psys_changed_type(), psys_make_temp_pointcache(), psys_prepare_physics(), and system_step().

◆ BKE_ptcache_id_from_rigidbody()

◆ BKE_ptcache_id_from_smoke()

void BKE_ptcache_id_from_smoke ( PTCacheID * pid,
struct Object * ob,
struct FluidModifierData * fmd )

The fluid modifier does not actually use this anymore, but some parts of Blender expect that it still has a point cache currently. For example, the fluid modifier uses DEG_add_collision_relations, which internally creates relations with the point cache.

Definition at line 994 of file pointcache.cc.

References PTCacheID::cache, PTCacheID::cache_ptr, PTCacheID::calldata, FluidModifierData::domain, Object::id, PointCache::index, PTCacheID::owner_id, FluidDomainSettings::point_cache, PTCACHE_TYPE_SMOKE_DOMAIN, FluidDomainSettings::ptcaches, PTCacheID::ptcaches, PTCacheID::stack_index, and PTCacheID::type.

Referenced by BKE_ptcache_object_reset(), and foreach_object_modifier_ptcache().

◆ BKE_ptcache_id_from_softbody()

◆ BKE_ptcache_id_reset()

◆ BKE_ptcache_id_time()

◆ BKE_ptcache_ids_from_object()

◆ BKE_ptcache_invalidate()

void BKE_ptcache_invalidate ( struct PointCache * cache)

◆ BKE_ptcache_load_external()

◆ BKE_ptcache_make_particle_key()

◆ BKE_ptcache_mem_index_find()

int BKE_ptcache_mem_index_find ( struct PTCacheMem * pm,
unsigned int index )

Is point with index in memory cache? Check to see if point number "index" is in pm (uses binary search for index data).

Definition at line 1672 of file pointcache.cc.

References BPHYS_DATA_INDEX, data, PTCacheMem::data, and PTCacheMem::totpoint.

Referenced by BKE_ptcache_mem_pointers_seek(), get_pointcache_keys_for_time(), get_pointcache_times_for_particle(), and psys_get_dietime_from_cache().

◆ BKE_ptcache_mem_pointers_incr()

void BKE_ptcache_mem_pointers_incr ( void * cur[BPHYS_TOT_DATA])

◆ BKE_ptcache_mem_pointers_init()

void BKE_ptcache_mem_pointers_init ( PTCacheMem * pm,
void * cur[BPHYS_TOT_DATA] )

◆ BKE_ptcache_mem_pointers_seek()

int BKE_ptcache_mem_pointers_seek ( int point_index,
PTCacheMem * pm,
void * cur[BPHYS_TOT_DATA] )

◆ BKE_ptcache_mem_to_disk()

◆ BKE_ptcache_object_has()

bool BKE_ptcache_object_has ( struct Scene * scene,
struct Object * ob,
int duplis )

◆ BKE_ptcache_object_reset()

◆ BKE_ptcache_quick_cache_all()

void BKE_ptcache_quick_cache_all ( struct Main * bmain,
struct Scene * scene,
struct ViewLayer * view_layer )

◆ BKE_ptcache_read()

◆ BKE_ptcache_toggle_disk_cache()

◆ BKE_ptcache_update_info()

◆ BKE_ptcache_validate()

void BKE_ptcache_validate ( struct PointCache * cache,
int framenr )

Set correct flags after successful simulation step.

Definition at line 3703 of file pointcache.cc.

References PointCache::flag, PTCACHE_SIMULATION_VALID, and PointCache::simframe.

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

◆ BKE_ptcache_write()

◆ direct_link_pointcache()

◆ direct_link_pointcache_mem()

◆ foreach_object_modifier_ptcache()

◆ foreach_object_particle_ptcache()

bool foreach_object_particle_ptcache ( Object * object,
PointCacheIdFn callback )
static

◆ foreach_object_ptcache()

◆ ptcache_add_extra_data()

void ptcache_add_extra_data ( PTCacheMem * pm,
uint type,
uint count,
void * data )
static

◆ ptcache_basic_header_read()

◆ ptcache_basic_header_write()

◆ ptcache_cloth_error()

void ptcache_cloth_error ( const ID * owner_id,
void * cloth_v,
const char * message )
static

◆ ptcache_cloth_extra_read()

◆ ptcache_cloth_extra_write()

void ptcache_cloth_extra_write ( void * cloth_v,
PTCacheMem * pm,
int  )
static

◆ ptcache_cloth_interpolate()

void ptcache_cloth_interpolate ( int index,
void * cloth_v,
void ** data,
float cfra,
float cfra1,
float cfra2,
const float * old_data )
static

◆ ptcache_cloth_read()

void ptcache_cloth_read ( int index,
void * cloth_v,
void ** data,
float ,
const float * old_data )
static

◆ ptcache_cloth_totpoint()

int ptcache_cloth_totpoint ( void * cloth_v,
int  )
static

Definition at line 637 of file pointcache.cc.

References ClothModifierData::clothObject, and Cloth::mvert_num.

Referenced by BKE_ptcache_id_from_cloth().

◆ ptcache_cloth_write()

int ptcache_cloth_write ( int index,
void * cloth_v,
void ** data,
int  )
static

◆ ptcache_copy()

◆ ptcache_data_alloc()

void ptcache_data_alloc ( PTCacheMem * pm)
static

◆ ptcache_data_copy()

void ptcache_data_copy ( void * from[],
void * to[] )
static

Definition at line 1771 of file pointcache.cc.

References BPHYS_TOT_DATA, i, and ptcache_data_size.

Referenced by ptcache_disk_frame_to_mem().

◆ ptcache_data_free()

void ptcache_data_free ( PTCacheMem * pm)
static

Definition at line 1760 of file pointcache.cc.

References BPHYS_TOT_DATA, data, PTCacheMem::data, i, and MEM_freeN().

Referenced by ptcache_mem_clear().

◆ ptcache_disk_frame_to_mem()

◆ ptcache_dt_to_str()

void ptcache_dt_to_str ( char * str,
size_t str_maxncpy,
double dtime )
static

Definition at line 3055 of file pointcache.cc.

References BLI_snprintf(), and str.

Referenced by BKE_ptcache_bake().

◆ ptcache_dynamicpaint_error()

void ptcache_dynamicpaint_error ( const ID * ,
void * ,
const char *  )
static

Definition at line 664 of file pointcache.cc.

Referenced by BKE_ptcache_id_from_dynamicpaint().

◆ ptcache_dynamicpaint_read()

◆ ptcache_dynamicpaint_totpoint()

int ptcache_dynamicpaint_totpoint ( void * sd,
int  )
static

◆ ptcache_dynamicpaint_write()

◆ ptcache_extra_free()

void ptcache_extra_free ( PTCacheMem * pm)
static

◆ ptcache_file_close()

void ptcache_file_close ( PTCacheFile * pf)
static

◆ ptcache_file_compressed_read()

◆ ptcache_file_compressed_write()

void ptcache_file_compressed_write ( PTCacheFile * pf,
const void * data,
uint items_num,
uint item_size )
static

◆ ptcache_file_data_read()

bool ptcache_file_data_read ( PTCacheFile * pf)
static

Definition at line 1588 of file pointcache.cc.

References BPHYS_TOT_DATA, i, pf, ptcache_data_size, and ptcache_file_read().

Referenced by ptcache_disk_frame_to_mem().

◆ ptcache_file_extension()

const char * ptcache_file_extension ( const PTCacheID * pid)
static

◆ ptcache_file_header_begin_read()

int ptcache_file_header_begin_read ( PTCacheFile * pf)
static

◆ ptcache_file_header_begin_write()

int ptcache_file_header_begin_write ( PTCacheFile * pf)
static

Definition at line 1631 of file pointcache.cc.

References pf.

Referenced by ptcache_mem_frame_to_disk(), and ptcache_write_stream().

◆ ptcache_file_open()

◆ ptcache_file_pointers_init()

◆ ptcache_file_read()

bool ptcache_file_read ( PTCacheFile * pf,
void * f,
uint items_num,
uint item_size )
static

◆ ptcache_file_write()

int ptcache_file_write ( PTCacheFile * pf,
const void * data,
uint items_num,
uint item_size )
static

Definition at line 1584 of file pointcache.cc.

References data, and pf.

Referenced by ptcache_dynamicpaint_write(), ptcache_file_compressed_write(), and ptcache_mem_frame_to_disk().

◆ ptcache_filepath()

◆ ptcache_filepath_ext_append()

size_t ptcache_filepath_ext_append ( PTCacheID * pid,
char filepath[MAX_PTCACHE_FILE],
const size_t filepath_len,
const bool use_frame_number,
const int cfra )
static

◆ ptcache_find_frames_around()

◆ ptcache_frame_from_filename()

int ptcache_frame_from_filename ( const char * filename,
const char * ext )
static

Similar to BLI_path_frame_get, but takes into account the stack-index which is after the frame.

Definition at line 1277 of file pointcache.cc.

References frame_len(), len, num, and STRNCPY().

Referenced by BKE_ptcache_disk_cache_rename(), BKE_ptcache_id_clear(), BKE_ptcache_id_time(), and BKE_ptcache_load_external().

◆ ptcache_interpolate()

◆ ptcache_mem_clear()

◆ ptcache_mem_frame_to_disk()

◆ ptcache_old_elemsize()

int ptcache_old_elemsize ( PTCacheID * pid)
static

◆ ptcache_particle_error()

void ptcache_particle_error ( const ID * ,
void * ,
const char *  )
static

Definition at line 465 of file pointcache.cc.

Referenced by BKE_ptcache_id_from_particles().

◆ ptcache_particle_extra_read()

◆ ptcache_particle_extra_write()

◆ ptcache_particle_interpolate()

◆ ptcache_particle_read()

◆ ptcache_particle_totpoint()

int ptcache_particle_totpoint ( void * psys_v,
int  )
static

Definition at line 459 of file pointcache.cc.

References ParticleSystem::totpart.

Referenced by BKE_ptcache_id_from_particles().

◆ ptcache_particle_totwrite()

◆ ptcache_particle_write()

◆ ptcache_path()

◆ ptcache_read()

◆ ptcache_read_stream()

◆ ptcache_rigidbody_error()

void ptcache_rigidbody_error ( const ID * ,
void * ,
const char *  )
static

Definition at line 848 of file pointcache.cc.

Referenced by BKE_ptcache_id_from_rigidbody().

◆ ptcache_rigidbody_interpolate()

void ptcache_rigidbody_interpolate ( int index,
void * rb_v,
void ** data,
float cfra,
float cfra1,
float cfra2,
const float * old_data )
static

◆ ptcache_rigidbody_read()

void ptcache_rigidbody_read ( int index,
void * rb_v,
void ** data,
float ,
const float * old_data )
static

◆ ptcache_rigidbody_totpoint()

int ptcache_rigidbody_totpoint ( void * rb_v,
int  )
static

Definition at line 841 of file pointcache.cc.

References RigidBodyWorld::numbodies.

Referenced by BKE_ptcache_id_from_rigidbody().

◆ ptcache_rigidbody_write()

◆ ptcache_softbody_error()

void ptcache_softbody_error ( const ID * ,
void * ,
const char *  )
static

Definition at line 242 of file pointcache.cc.

Referenced by BKE_ptcache_id_from_softbody().

◆ ptcache_softbody_interpolate()

void ptcache_softbody_interpolate ( int index,
void * soft_v,
void ** data,
float cfra,
float cfra1,
float cfra2,
const float * old_data )
static

◆ ptcache_softbody_read()

void ptcache_softbody_read ( int index,
void * soft_v,
void ** data,
float ,
const float * old_data )
static

◆ ptcache_softbody_totpoint()

int ptcache_softbody_totpoint ( void * soft_v,
int  )
static

Definition at line 237 of file pointcache.cc.

References SoftBody::totpoint.

Referenced by BKE_ptcache_id_from_softbody().

◆ ptcache_softbody_write()

int ptcache_softbody_write ( int index,
void * soft_v,
void ** data,
int  )
static

◆ ptcache_write()

◆ ptcache_write_needed()

◆ ptcache_write_stream()

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"physics.pointcache"}
static

Definition at line 97 of file pointcache.cc.

◆ ptcache_data_size

int ptcache_data_size[]
static
Initial value:
= {
sizeof(uint),
sizeof(float[3]),
sizeof(float[3]),
sizeof(float[4]),
sizeof(float[3]),
sizeof(float),
sizeof(float[3]),
sizeof(BoidData),
}
unsigned int uint

Definition at line 99 of file pointcache.cc.

Referenced by BKE_ptcache_data_size(), BKE_ptcache_mem_pointers_incr(), BKE_ptcache_mem_pointers_seek(), ptcache_data_alloc(), ptcache_data_copy(), ptcache_disk_frame_to_mem(), ptcache_file_data_read(), and ptcache_mem_frame_to_disk().

◆ ptcache_extra_datasize

int ptcache_extra_datasize[]
static
Initial value:
= {
0,
sizeof(ParticleSpring),
sizeof(float[3]),
}

Definition at line 110 of file pointcache.cc.

Referenced by ptcache_add_extra_data(), ptcache_disk_frame_to_mem(), and ptcache_mem_frame_to_disk().