80#define PTCACHE_DATA_FROM(data, type, from) \
82 memcpy(data[type], from, ptcache_data_size[type]); \
86#define PTCACHE_DATA_TO(data, type, index, to) \
89 (char *)(data)[type] + ((index) ? (index) * ptcache_data_size[type] : 0), \
90 ptcache_data_size[type]); \
95#define DURIAN_POINTCACHE_LIB_OK 1
134 if (!
error && !fread(&
pf->totpoint,
sizeof(
uint), 1,
pf->fp)) {
138 if (!
error && !fread(&
pf->data_types,
sizeof(
uint), 1,
pf->fp)) {
147 if (!fwrite(&
pf->totpoint,
sizeof(
uint), 1,
pf->fp)) {
151 if (!fwrite(&
pf->data_types,
sizeof(
uint), 1,
pf->fp)) {
183 int index,
void *soft_v,
void **
data,
float ,
const float *old_data)
189 memcpy(bp->
pos,
data,
sizeof(
float[3]));
190 memcpy(bp->
vec,
data + 3,
sizeof(
float[3]));
203 const float *old_data)
210 if (cfra1 == cfra2) {
218 memcpy(keys[2].co, old_data,
sizeof(
float[3]));
219 memcpy(keys[2].vel, old_data + 3,
sizeof(
float[3]));
225 dfra = cfra2 - cfra1;
279 if (cfra < pa->time -
step) {
285 const int pa_sfra = int(pa->
time) -
step;
287 if (!(cfra >= pa_sfra && cfra <= pa_efra)) {
314 int index,
void *psys_v,
void **
data,
float cfra,
const float *old_data)
341 if (cfra < pa->time) {
387 const float *old_data)
405 if (!(cfra1 >= pa_sfra && cfra1 <= pa_efra)) {
409 cfra = std::min(cfra, pa->
dietime);
410 cfra1 = std::min(cfra1, pa->
dietime);
411 cfra2 = std::min(cfra2, pa->
dietime);
413 if (cfra1 == cfra2) {
419 keys[2] = *
reinterpret_cast<const ParticleKey *
>(old_data);
427 if (keys[1].time > keys[2].time) {
429 mul_v3_fl(keys[2].vel, (keys[1].time - keys[2].time) * timestep);
433 mul_v3_fl(keys[2].vel, (keys[2].time - keys[1].time) * timestep);
442 if (cfra > pa->
time) {
443 cfra1 = std::max(cfra1, pa->
time);
446 dfra = cfra2 - cfra1;
485 for (p = 0; p < psys->
totpart; p++, pa++) {
486 const int pa_sfra = int(pa->
time) -
step;
487 totwrite += (cfra >= pa_sfra);
491 for (p = 0; p < psys->
totpart; p++, pa++) {
493 const int pa_sfra = int(pa->
time) -
step;
495 totwrite += (cfra >= pa_sfra) && (cfra <= pa_efra);
520 for (; extra; extra = extra->
next) {
521 switch (extra->
type) {
549 int index,
void *cloth_v,
void **
data,
float ,
const float *old_data)
556 memcpy(vert->
x,
data,
sizeof(
float[3]));
557 memcpy(vert->
xconst,
data + 3,
sizeof(
float[3]));
558 memcpy(vert->
v,
data + 6,
sizeof(
float[3]));
572 const float *old_data)
580 if (cfra1 == cfra2) {
588 memcpy(keys[2].co, old_data,
sizeof(
float[3]));
589 memcpy(keys[2].vel, old_data + 6,
sizeof(
float[3]));
595 dfra = cfra2 - cfra1;
627 for (; extra; extra = extra->
next) {
628 switch (extra->
type) {
657 if (!surface->
data) {
671#define DPAINT_CACHE_VERSION "1.01"
691 in_stride =
sizeof(
float);
723 if (surface_type != surface->
type) {
732 data_len =
sizeof(
float);
744 CLOG_ERROR(&
LOG,
"Dynamic Paint: Unable to read the compressed cache data");
777 int index,
void *rb_v,
void **
data,
float ,
const float *old_data)
792 memcpy(rbo->
pos,
data,
sizeof(
float[3]));
793 memcpy(rbo->
orn,
data + 3,
sizeof(
float[4]));
808 const float *old_data)
824 float pos[3], orn[4];
827 memcpy(
pos,
data,
sizeof(
float[3]));
828 memcpy(orn,
data + 3,
sizeof(
float[4]));
835 const float t = (cfra - cfra1) / (cfra2 - cfra1);
1054 pid->
owner_id = ob !=
nullptr ? &ob->
id :
nullptr;
1095 if (pid->cache == cache) {
1124 if (psys->part ==
nullptr) {
1142 if (!callback(pid,
nullptr)) {
1157 if (!callback(pid, md)) {
1165 if (!callback(pid, md)) {
1175 for (; surface; surface = surface->
next) {
1177 if (!callback(pid, md)) {
1195 if (
object !=
nullptr) {
1197 if (object->
soft !=
nullptr) {
1199 if (!callback(pid,
nullptr)) {
1216 if (current_object ==
object) {
1226 if (scene !=
nullptr && (
object ==
nullptr || object->
rigidbody_object !=
nullptr) &&
1230 if (!callback(pid,
nullptr)) {
1255 bool has_point_cache =
false;
1257 has_point_cache =
true;
1260 return has_point_cache;
1280 const int ext_len =
frame_len + strlen(ext);
1281 const int len = strlen(filename);
1284 if (
len > ext_len) {
1301#define MAX_PTCACHE_PATH FILE_MAX
1302#define MAX_PTCACHE_FILE (FILE_MAX * 2)
1309 lib->runtime->filepath_abs :
1321 if ((blendfile_path[0] !=
'\0') ||
lib) {
1344 const size_t filepath_len,
1345 const bool use_frame_number,
1348 size_t len = filepath_len;
1350 filename_ext = filepath + filepath_len;
1351 *filename_ext =
'\0';
1360 if (use_frame_number) {
1408 if (blendfile_path[0] ==
'\0') {
1421 while (
'\0' != *idname) {
1451#ifndef DURIAN_POINTCACHE_LIB_OK
1459 if (blendfile_path[0] ==
'\0') {
1505 uchar compressed_val = 0;
1511 in_len = size_t(
size);
1522 "pointcache_unfilter_buffer");
1524 if (
ELEM(compressed,
1529 const size_t err = ZSTD_decompress(decomp_result, items_num * item_size,
in, in_len);
1530 r = ZSTD_isError(err);
1559 const uint data_size = items_num * item_size;
1560 size_t out_len = ZSTD_compressBound(data_size);
1568 const int zstd_level = 3;
1569 size_t res = ZSTD_compress(
out.data(), out_len, filtered.
data(), data_size, zstd_level);
1573 const uchar compression_val = compression;
1582 return (fread(f, item_size, items_num,
pf->fp) == items_num);
1586 return (fwrite(
data, item_size, items_num,
pf->fp) == items_num);
1609 if (fread(bphysics,
sizeof(
char), 8,
pf->fp) != 8) {
1617 if (!
error && !fread(&typeflag,
sizeof(
uint), 1,
pf->fp)) {
1633 const char *bphysics =
"BPHYSICS";
1634 uint typeflag =
pf->type +
pf->flag;
1636 if (fwrite(bphysics,
sizeof(
char), 8,
pf->fp) != 8) {
1640 if (!fwrite(&typeflag,
sizeof(
uint), 1,
pf->fp)) {
1656 int data_types =
pf->data_types;
1678 if (index < *data || index > *(
data + high)) {
1683 if (index - *
data < high &&
data[index - *
data] == index) {
1684 return index - *
data;
1687 while (low <= high) {
1688 mid = (low + high) / 2;
1690 if (
data[mid] > index) {
1693 else if (
data[mid] < index) {
1704 return (index < pm->totpoint ? index : -1);
1713 cur[
i] = ((data_types & (1 <<
i)) ? pm->
data[
i] :
nullptr);
1755 if (data_types & (1 <<
i)) {
1777 if (from[
i] && to[
i]) {
1788 for (; extra; extra = extra->
next) {
1807 return sizeof(
float[6]);
1813 return sizeof(
float[9]);
1822 int cfra1 = frame, cfra2 = frame + 1;
1828 if (cfra1 < pid->cache->startframe) {
1840 if (cfra1 && !cfra2) {
1857 if (pm2->
frame < frame) {
1868 *r_fra2 = pm->
frame;
1871 *r_fra1 = pm->
frame;
1872 *r_fra2 = pm2->
frame;
1883 if (
pf ==
nullptr) {
1906 if (
pf->data_types & (1 <<
i)) {
1934 extra->
type = extratype;
1939 "Pointcache extradata->data");
1964 printf(
"Error reading from disk cache\n");
1978 if (
pf ==
nullptr) {
1980 printf(
"Error opening disk cache file for writing\n");
2011 for (; extra; extra = extra->
next) {
2012 if (extra->
data ==
nullptr || extra->
totdata == 0) {
2027 printf(
"Error writing to disk cache\n");
2042 if (
pf ==
nullptr) {
2044 printf(
"Error opening disk cache file for reading\n");
2053 else if (
pf->type != pid->
type) {
2094 while (pm && pm->
frame != cfra) {
2106 if (totpoint != pid_totpoint) {
2108 totpoint = std::min(totpoint, pid_totpoint);
2115 for (
i = 0;
i < totpoint;
i++) {
2151 while (pm && pm->
frame != cfra2) {
2163 if (totpoint != pid_totpoint) {
2165 totpoint = std::min(totpoint, pid_totpoint);
2172 for (
i = 0;
i < totpoint;
i++) {
2178 *index, pid->
calldata, cur, cfra,
float(cfra1),
float(cfra2),
nullptr);
2198 int cfrai = int(
floor(cfra)), cfra1 = 0, cfra2 = 0;
2221 if (cfra1 == 0 && cfra2 == 0) {
2226 if (no_extrapolate_old) {
2227 if (cfra1 == 0 && cfra2 && cfra2 <= pid->cache->simframe) {
2230 if (cfra1 && cfra1 == cfra2) {
2236 if (cfra1 && cfra1 == cfra2) {
2282 if (cfra <= pid->cache->last_exact) {
2300 if (
pf ==
nullptr) {
2302 printf(
"Error opening disk cache file for writing\n");
2308 pf->totpoint = totpoint;
2323 printf(
"Error writing to disk cache\n");
2361 for (
i = 0;
i < totpoint;
i++) {
2405 int ofra = 0, efra = cache->
endframe;
2437 if (pm ==
nullptr) {
2445 if (efra >= cache->
startframe && cfra > efra) {
2466 int overwrite = 0,
error = 0;
2532#ifndef DURIAN_POINTCACHE_LIB_OK
2548 if (dir ==
nullptr) {
2556 if (
len <
sizeof(filepath) - 2) {
2563 while ((de =
readdir(dir)) !=
nullptr) {
2564 if (strstr(de->
d_name, ext)) {
2603 for (; pm; pm = pm->
next) {
2643 for (; pm; pm = pm->
next) {
2644 if (pm->
frame == cfra) {
2666 if (cfra < pid->cache->startframe || cfra > pid->
cache->
endframe) {
2684 for (; pm; pm = pm->
next) {
2685 if (pm->
frame == cfra) {
2692 PTCacheID *pid,
Scene *scene,
float cfra,
int *startframe,
int *endframe,
float *timescale)
2697 float time, nexttime;
2717 *timescale = std::max(nexttime - time, 0.0f);
2720 if (startframe && endframe) {
2740 "cached frames array");
2756 if (dir ==
nullptr) {
2762 while ((de =
readdir(dir)) !=
nullptr) {
2763 if (strstr(de->
d_name, ext)) {
2768 if ((frame != -1) && (frame >= sta && frame <= end)) {
2868 else if (psys->clmd) {
2880 if (skip == 0 && psys->part) {
2897 for (; surface; surface = surface->
next) {
2953 for (; pm; pm = pm->
next) {
3014 ncache->
edit =
nullptr;
3027 for (; cache; cache = cache->
next) {
3043 memset(&baker, 0,
sizeof(baker));
3044 baker.
bmain = bmain;
3045 baker.
scene = scene;
3058 if (dtime > 3600.0) {
3063 int(dtime / 60) % 60,
3067 BLI_snprintf(
str, str_maxncpy,
"%im %is",
int(dtime / 60) % 60,
int(dtime) % 60);
3086 int cfrao = scene->
r.
cfra;
3089 int render = baker->
render;
3141 endframe = std::min(endframe, cache->
endframe);
3181 startframe = std::min(startframe, cache->
startframe);
3183 if (
bake || render) {
3187 endframe = std::max(endframe, cache->
endframe);
3198 scene->
r.
cfra = startframe;
3203 bool use_timer =
false;
3204 double stime, ptime, ctime, fetd;
3205 char run[32], cur[32], etd[32];
3210 for (
int fr = scene->
r.
cfra; fr <= endframe; fr += baker->quick_step, scene->
r.
cfra = fr) {
3214 float progress = (
float(scene->
r.
cfra - startframe) /
float(endframe - startframe));
3219 printf(
"bake: frame %d :: %d\n", scene->
r.
cfra, endframe);
3224 fetd = (ctime - ptime) * (endframe - scene->
r.
cfra) / baker->
quick_step;
3226 if (use_timer || fetd > 60.0) {
3233 printf(
"Baked for %s, current frame: %i/%i (%.3fs), ETC: %s\r",
3235 scene->
r.
cfra - startframe + 1,
3236 endframe - startframe + 1,
3245 if (cancel ||
G.is_break) {
3255 printf(
"\nBake %s %s (%i frames simulated).\n",
3256 (cancel ?
"canceled after" :
"finished in"),
3258 scene->
r.
cfra - startframe);
3334 scene->
r.
cfra = cfrao;
3359 cache->
flag |= baked;
3361 for (cfra = sfra; cfra <= efra; cfra++) {
3382 cache->
flag |= baked;
3384 for (; pm; pm = pm->
next) {
3402 if (blendfile_path[0] ==
'\0') {
3405 printf(
"File must be saved before using disk cache!\n");
3455 if (
STREQ(name_src, name_dst)) {
3469 if (dir ==
nullptr) {
3479 while ((de =
readdir(dir)) !=
nullptr) {
3480 if (strstr(de->
d_name, ext)) {
3523 if (dir ==
nullptr) {
3529 if (cache->
index >= 0) {
3536 while ((de =
readdir(dir)) !=
nullptr) {
3537 if (strstr(de->
d_name, ext)) {
3544 start = std::min(start, frame);
3545 end = std::max(end, frame);
3622 for (; cfra <= cache->
endframe; cfra++) {
3632 else if (totframes && cache->
totpoint) {
3646 SNPRINTF(mem_info,
RPT_(
"%i cells + High Resolution cached"), totpoint);
3655 for (; cfra <= cache->
endframe; cfra++) {
3661 SNPRINTF(mem_info,
RPT_(
"%i frames on disk"), totframes);
3668 long long int bytes = 0.0f;
3671 for (; pm; pm = pm->
next) {
3689 SNPRINTF(mem_info,
RPT_(
"%s frames in memory (%s)"), formatted_tot, formatted_mem);
3729 if (pm->data[
i] && pm->data_types & (1 <<
i)) {
3735 writer, pm->totpoint,
reinterpret_cast<uint32_t *
>(pm->data[
i]));
3753 else if (extra->data) {
3787 else if (extra->data) {
3788 extra->data =
nullptr;
3807 cache->
edit =
nullptr;
3818 if (ptcaches->
first) {
3836 (*ocache)->step = 1;
3839 ptcaches->
first = ptcaches->
last = *ocache;
void BIK_clear_cache(struct bPose *pose)
void cloth_free_modifier(ClothModifierData *clmd)
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_END
#define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object)
constexpr int MAX_DUPLI_RECUR
void dynamicPaint_clearSurface(const struct Scene *scene, struct DynamicPaintSurface *surface)
const char * BKE_main_blendfile_path_from_global()
void BKE_modifier_set_error(const Object *ob, ModifierData *md, const char *format,...) ATTR_PRINTF_FORMAT(3
General operations, lookup, etc. for blender objects.
int BKE_object_insert_ptcache(Object *ob)
void BKE_object_delete_ptcache(Object *ob, int index)
void psys_get_pointcache_start_end(struct Scene *scene, ParticleSystem *psys, int *sfra, int *efra)
void psys_interpolate_particle(short type, struct ParticleKey keys[4], float dt, struct ParticleKey *result, bool velocity)
void psys_reset(struct ParticleSystem *psys, int mode)
struct ParticleSystem * psys_eval_get(struct Depsgraph *depsgraph, struct Object *object, struct ParticleSystem *psys)
#define PSYS_RESET_DEPSGRAPH
#define PTCACHE_TYPEFLAG_TYPEMASK
#define PTCACHE_FILE_READ
#define PTCACHE_TYPE_SMOKE_HIGHRES
#define PTCACHE_VEL_PER_SEC
#define PTCACHE_FILE_WRITE
#define PTCACHE_CLEAR_BEFORE
#define PTCACHE_CLEAR_AFTER
#define PTCACHE_TYPE_CLOTH
#define PTCACHE_TYPE_DYNAMICPAINT
bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
blender::FunctionRef< bool(PTCacheID &pid, ModifierData *md)> PointCacheIdFn
#define PTCACHE_CLEAR_ALL
#define PTCACHE_READ_INTERPOLATED
#define PTCACHE_TYPE_PARTICLES
#define PTCACHE_TYPEFLAG_FLAGMASK
#define PTCACHE_TYPE_SOFTBODY
#define PTCACHE_TYPEFLAG_COMPRESS
#define PTCACHE_FILE_UPDATE
#define PTCACHE_CLEAR_FRAME
#define PTCACHE_TYPE_SMOKE_DOMAIN
#define PTCACHE_RESET_OUTDATED
#define PTCACHE_TYPE_RIGIDBODY
#define PTCACHE_RESET_DEPSGRAPH
#define PTCACHE_RESET_BAKED
#define PTCACHE_READ_EXACT
#define PTCACHE_TYPEFLAG_EXTRADATA
float BKE_scene_ctime_get(const Scene *scene)
#define SETLOOPER_VIEW_LAYER(_sce_basis, _view_layer, _sce_iter, _base)
void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
float BKE_scene_frame_to_ctime(const Scene *scene, int frame)
void sbFreeSimulation(struct SoftBody *sb)
#define BLI_assert_unreachable()
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL()
int BLI_rename_overwrite(const char *from, const char *to) ATTR_NONNULL()
int BLI_fseek(FILE *stream, int64_t offset, int whence)
bool BLI_file_ensure_parent_dir_exists(const char *filepath) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE void BLI_listbase_clear(ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
void vec_to_quat(float q[4], const float vec[3], short axis, short upflag)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3(float r[3])
ATTR_WARN_UNUSED_RESULT const size_t num
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool bool BLI_path_extension_strip(char *path) ATTR_NONNULL(1)
#define BLI_path_join(...)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
int BLI_path_slash_ensure(char *path, size_t path_maxncpy) ATTR_NONNULL(1)
size_t BLI_str_format_int_grouped(char dst[BLI_STR_FORMAT_INT32_GROUPED_SIZE], int num) ATTR_NONNULL(1)
#define BLI_STR_FORMAT_INT64_BYTE_UNIT_SIZE
#define SNPRINTF(dst, format,...)
#define BLI_STR_FORMAT_INT32_GROUPED_SIZE
void BLI_str_format_byte_unit(char dst[BLI_STR_FORMAT_INT64_BYTE_UNIT_SIZE], long long int bytes, bool base_10) ATTR_NONNULL(1)
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * STRNCPY(char(&dst)[N], const char *src)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
Platform independent time functions.
double BLI_time_now_seconds(void)
#define STREQLEN(a, b, n)
Compatibility-like things for windows.
struct dirent * readdir(DIR *dp)
const char * dirname(char *path)
DIR * opendir(const char *path)
void BLO_write_float_array(BlendWriter *writer, int64_t num, const float *data_ptr)
void BLO_read_uint32_array(BlendDataReader *reader, int64_t array_size, uint32_t **ptr_p)
void BLO_read_float_array(BlendDataReader *reader, int64_t array_size, float **ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_read_struct_list(reader, struct_name, list)
void BLO_write_uint32_array(BlendWriter *writer, int64_t num, const uint32_t *data_ptr)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
#define BLO_read_struct(reader, struct_name, ptr_p)
#define CLOG_ERROR(clg_ref,...)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
ID and Library types, which are fundamental for SDNA.
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_T_DISPLACE
@ MOD_DPAINT_SURFACE_T_WAVE
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ FLUID_DOMAIN_CACHE_REPLAY
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
@ SPH_VISCOELASTIC_SPRINGS
@ BPHYS_DATA_DYNAMICPAINT
@ PTCACHE_COMPRESS_ZSTD_FAST_DEPRECATED
@ PTCACHE_COMPRESS_ZSTD_FILTERED
@ PTCACHE_COMPRESS_ZSTD_SLOW_DEPRECATED
@ PTCACHE_FLAG_INFO_DIRTY
@ PTCACHE_SIMULATION_VALID
@ BPHYS_EXTRA_FLUID_SPRINGS
@ BPHYS_EXTRA_CLOTH_ACCELERATION
Types and defines for representing Rigid Body entities.
Read Guarded memory(de)allocation.
static void copy_data(const ModifierData *md, ModifierData *target, const int flag)
static float frame_len(const Frame *frame)
Rigid Body API for interfacing with external Physics Engines.
BMesh const char void * data
BPy_StructRNA * depsgraph
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void reset()
clear internal cached data and reset random seed
#define pf(_x, _i)
Prefetch 64.
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
void * MEM_mallocN(size_t len, const char *str)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_dupallocN(const void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void MEM_freeN(void *vmemh)
static void error(const char *str)
static void clear(Message &msg)
void filter_transpose_delta(const uint8_t *src, uint8_t *dst, size_t items_num, size_t item_size)
void unfilter_transpose_delta(const uint8_t *src, uint8_t *dst, size_t items_num, size_t item_size)
static int ptcache_rigidbody_totpoint(void *rb_v, int)
int BKE_ptcache_data_size(int data_type)
#define PTCACHE_DATA_FROM(data, type, from)
int BKE_ptcache_mem_index_find(PTCacheMem *pm, uint index)
static int ptcache_basic_header_read(PTCacheFile *pf)
static void ptcache_data_copy(void *from[], void *to[])
void BKE_ptcache_disk_to_mem(PTCacheID *pid)
void BKE_ptcache_mem_pointers_incr(void *cur[BPHYS_TOT_DATA])
static int ptcache_cloth_totpoint(void *cloth_v, int)
static int ptcache_softbody_totpoint(void *soft_v, int)
static PTCacheFile * ptcache_file_open(PTCacheID *pid, int mode, int cfra)
static int ptcache_particle_totwrite(void *psys_v, int cfra)
static void ptcache_particle_interpolate(int index, void *psys_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static void ptcache_add_extra_data(PTCacheMem *pm, uint type, uint count, void *data)
PTCacheID BKE_ptcache_id_find(Object *ob, Scene *scene, PointCache *cache)
void BKE_ptcache_invalidate(PointCache *cache)
void BKE_ptcache_load_external(PTCacheID *pid)
static void ptcache_file_close(PTCacheFile *pf)
static int ptcache_filepath(PTCacheID *pid, char filepath[MAX_PTCACHE_FILE], int cfra, const bool do_path, const bool do_ext)
static int ptcache_read(PTCacheID *pid, int cfra)
static int ptcache_dynamicpaint_totpoint(void *sd, int)
static void ptcache_cloth_extra_write(void *cloth_v, PTCacheMem *pm, int)
void BKE_ptcache_mem_to_disk(PTCacheID *pid)
static void ptcache_file_compressed_write(PTCacheFile *pf, const void *data, uint items_num, uint item_size)
static int ptcache_file_compressed_read(PTCacheFile *pf, uchar *result, uint items_num, uint item_size)
static const char * ptcache_file_extension(const PTCacheID *pid)
void BKE_ptcache_make_particle_key(ParticleKey *key, int index, void **data, float time)
static void ptcache_softbody_read(int index, void *soft_v, void **data, float, const float *old_data)
static int ptcache_dynamicpaint_write(PTCacheFile *pf, void *dp_v)
static bool ptcache_file_data_read(PTCacheFile *pf)
static int ptcache_data_size[]
void BKE_ptcache_id_from_rigidbody(PTCacheID *pid, Object *ob, RigidBodyWorld *rbw)
void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, Object *ob, DynamicPaintSurface *surface)
static void direct_link_pointcache_mem(BlendDataReader *reader, PTCacheMem *pm)
static void ptcache_data_alloc(PTCacheMem *pm)
static void ptcache_cloth_extra_read(void *cloth_v, PTCacheMem *pm, float)
void BKE_ptcache_foreach_object_cache(Object &ob, Scene &scene, bool duplis, PointCacheIdFn fn)
static int ptcache_write(PTCacheID *pid, int cfra, int overwrite)
void BKE_ptcache_update_info(PTCacheID *pid)
static int ptcache_mem_frame_to_disk(PTCacheID *pid, PTCacheMem *pm)
void BKE_ptcache_id_clear(PTCacheID *pid, int mode, uint cfra)
static int ptcache_write_stream(PTCacheID *pid, int cfra, int totpoint)
static int ptcache_cloth_write(int index, void *cloth_v, void **data, int)
void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
static void direct_link_pointcache(BlendDataReader *reader, PointCache *cache)
static PTCacheMem * ptcache_disk_frame_to_mem(PTCacheID *pid, int cfra)
static int ptcache_particle_totpoint(void *psys_v, int)
static bool ptcache_file_read(PTCacheFile *pf, void *f, uint items_num, uint item_size)
static void ptcache_file_pointers_init(PTCacheFile *pf)
bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
void BKE_ptcache_free_mem(ListBase *mem_cache)
void BKE_ptcache_free_list(ListBase *ptcaches)
static int ptcache_read_stream(PTCacheID *pid, int cfra)
static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
void BKE_ptcache_quick_cache_all(Main *bmain, Scene *scene, ViewLayer *view_layer)
static int ptcache_rigidbody_write(int index, void *rb_v, void **data, int)
static int ptcache_path(PTCacheID *pid, char dirname[MAX_PTCACHE_PATH])
static void ptcache_particle_extra_write(void *psys_v, PTCacheMem *pm, int)
void BKE_ptcache_mem_pointers_init(PTCacheMem *pm, void *cur[BPHYS_TOT_DATA])
PointCache * BKE_ptcache_copy_list(ListBase *ptcaches_new, const ListBase *ptcaches_old, const int flag)
static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v)
void BKE_ptcache_id_from_smoke(PTCacheID *pid, Object *ob, FluidModifierData *fmd)
void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *clmd)
static bool foreach_object_ptcache(Scene *scene, Object *object, int duplis, PointCacheIdFn callback)
static int ptcache_extra_datasize[]
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_frame_from_filename(const char *filename, const char *ext)
void BKE_ptcache_blend_read_data(BlendDataReader *reader, ListBase *ptcaches, PointCache **ocache, int force_disk)
bool BKE_ptcache_object_has(Scene *scene, Object *ob, int duplis)
int BKE_ptcache_mem_pointers_seek(int point_index, PTCacheMem *pm, void *cur[BPHYS_TOT_DATA])
void BKE_ptcache_bake(PTCacheBaker *baker)
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old)
static void ptcache_softbody_error(const ID *, void *, const char *)
void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int duplis)
static void ptcache_cloth_read(int index, void *cloth_v, void **data, float, const float *old_data)
static void ptcache_particle_read(int index, void *psys_v, void **data, float cfra, const float *old_data)
static PointCache * ptcache_copy(PointCache *cache, const bool copy_data)
int BKE_ptcache_write(PTCacheID *pid, uint cfra)
static int ptcache_file_write(PTCacheFile *pf, const void *data, uint items_num, uint item_size)
static void ptcache_cloth_error(const ID *owner_id, void *cloth_v, const char *message)
static void ptcache_rigidbody_error(const ID *, void *, const char *)
void BKE_ptcache_free(PointCache *cache)
static int ptcache_old_elemsize(PTCacheID *pid)
static bool foreach_object_modifier_ptcache(Object *object, PointCacheIdFn callback)
void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const char *name_dst)
static int ptcache_interpolate(PTCacheID *pid, float cfra, int cfra1, int cfra2)
void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb)
void BKE_ptcache_toggle_disk_cache(PTCacheID *pid)
int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode)
#define PTCACHE_DATA_TO(data, type, index, to)
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_particle_write(int index, void *psys_v, void **data, int cfra)
static bool foreach_object_particle_ptcache(Object *object, PointCacheIdFn callback)
static void ptcache_particle_extra_read(void *psys_v, PTCacheMem *pm, float)
#define DPAINT_CACHE_VERSION
static void ptcache_dynamicpaint_error(const ID *, void *, const char *)
static int ptcache_file_header_begin_write(PTCacheFile *pf)
void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys)
static int ptcache_softbody_write(int index, void *soft_v, void **data, int)
static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
static void ptcache_find_frames_around(PTCacheID *pid, uint frame, int *r_fra1, int *r_fra2)
PointCache * BKE_ptcache_add(ListBase *ptcaches)
static void ptcache_mem_clear(PTCacheMem *pm)
static int ptcache_write_needed(PTCacheID *pid, int cfra, int *overwrite)
void BKE_ptcache_validate(PointCache *cache, int framenr)
static void ptcache_data_free(PTCacheMem *pm)
static int ptcache_file_header_begin_read(PTCacheFile *pf)
static void ptcache_extra_free(PTCacheMem *pm)
static void ptcache_rigidbody_read(int index, void *rb_v, void **data, float, const float *old_data)
int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
static void ptcache_dt_to_str(char *str, size_t str_maxncpy, double dtime)
static int ptcache_basic_header_write(PTCacheFile *pf)
static void ptcache_particle_error(const ID *, void *, const char *)
void BKE_ptcache_blend_write(BlendWriter *writer, ListBase *ptcaches)
void RB_body_get_orientation(rbRigidBody *object, float v_out[4])
void RB_body_get_position(rbRigidBody *object, float v_out[3])
struct ClothHairData * hairdata
struct Cloth * clothObject
struct PointCache * point_cache
float average_acceleration[3]
struct DynamicPaintCanvasSettings * canvas
struct PaintSurfaceData * data
struct DynamicPaintSurface * next
struct PointCache * pointcache
struct ListBase ptcaches[2]
struct PointCache * point_cache[2]
struct FluidDomainSettings * domain
struct ModifierData * next
struct Collection * instance_collection
struct RigidBodyOb * rigidbody_object
struct RigidBodyCon * rigidbody_constraint
void(* update_progress)(void *data, float progress, int *cancel)
struct Depsgraph * depsgraph
struct ViewLayer * view_layer
struct PointCache ** cache_ptr
int(* write_stream)(PTCacheFile *pf, void *calldata)
int(* write_point)(int index, void *calldata, void **data, int cfra)
int(* write_header)(PTCacheFile *pf)
void(* read_point)(int index, void *calldata, void **data, float cfra, const float *old_data)
void(* interpolate_extra_data)(void *calldata, struct PTCacheMem *pm, float cfra, float cfra1, float cfra2)
struct ListBase * ptcaches
void(* read_extra_data)(void *calldata, struct PTCacheMem *pm, float cfra)
void(* interpolate_point)(int index, void *calldata, void **data, float cfra, float cfra1, float cfra2, const float *old_data)
unsigned int default_step
int(* totpoint)(void *calldata, int cfra)
int(* totwrite)(void *calldata, int cfra)
void(* write_extra_data)(void *calldata, struct PTCacheMem *pm, int cfra)
int(* read_stream)(PTCacheFile *pf, void *calldata)
void(* error)(const struct ID *owner_id, void *calldata, const char *message)
int(* read_header)(PTCacheFile *pf)
struct PointCache * cache
struct ListBase extradata
struct SPHFluidSettings * fluid
ParticleSpring * fluid_springs
struct ParticleSystem * next
struct PointCache * pointcache
struct ListBase mem_cache
struct PTCacheEdit * edit
void(* free_edit)(struct PTCacheEdit *edit)
struct RigidBodyOb_Shared * shared
struct PointCache * pointcache
struct RigidBodyWorld_Shared * shared
struct PhysicsSettings physics_settings
struct RigidBodyWorld * rigidbody_world
struct PointCache * pointcache
struct SoftBody_Shared * shared
struct BodyPoint * bpoint
void * BKE_tempdir_session
static DynamicLibrary lib