92 #define DT_DEFAULT 0.1f
95 #define PHI_MAX 9999.0f
115 # define ADD_IF_LOWER_POS(a, b) (min_ff((a) + (b), max_ff((a), (b))))
116 # define ADD_IF_LOWER_NEG(a, b) (max_ff((a) + (b), min_ff((a), (b))))
117 # define ADD_IF_LOWER(a, b) (((b) > 0) ? ADD_IF_LOWER_POS((a), (b)) : ADD_IF_LOWER_NEG((a), (b)))
121 if (free_old && fds->
fluid) {
124 if (!
min_iii(res[0], res[1], res[2])) {
149 int new_shift[3] = {0};
155 int o_total_cells = o_res[0] * o_res[1] * o_res[2];
156 int n_total_cells = n_res[0] * n_res[1] * n_res[2];
159 if (o_total_cells > 1 && n_total_cells > 1) {
216 for (
int z = o_min[2];
z < o_max[2];
z++) {
217 for (
int y = o_min[1];
y < o_max[1];
y++) {
218 for (
int x = o_min[0];
x < o_max[0];
x++) {
220 int xo =
x - o_min[0];
221 int yo =
y - o_min[1];
222 int zo =
z - o_min[2];
225 int xn =
x - n_min[0] - new_shift[0];
226 int yn =
y - n_min[1] - new_shift[1];
227 int zn =
z - n_min[2] - new_shift[2];
231 if (xn < 0 || xn >= n_res[0] || yn < 0 || yn >= n_res[1] || zn < 0 || zn >= n_res[2]) {
245 if (xo < bwidth || yo < bwidth || zo < bwidth || xo >= o_res[0] - bwidth ||
246 yo >= o_res[1] - bwidth || zo >= o_res[2] - bwidth) {
250 if (xn < bwidth || yn < bwidth || zn < bwidth || xn >= n_res[0] - bwidth ||
251 yn >= n_res[1] - bwidth || zn >= n_res[2] - bwidth) {
260 int xx_o = xo * block_size;
261 int yy_o = yo * block_size;
262 int zz_o = zo * block_size;
264 int xx_n = xn * block_size;
265 int yy_n = yn * block_size;
266 int zz_n = zn * block_size;
269 n_wt_tcu[index_new] = o_wt_tcu[index_old];
270 n_wt_tcv[index_new] = o_wt_tcv[index_old];
271 n_wt_tcw[index_new] = o_wt_tcw[index_old];
273 n_wt_tcu2[index_new] = o_wt_tcu2[index_old];
274 n_wt_tcv2[index_new] = o_wt_tcv2[index_old];
275 n_wt_tcw2[index_new] = o_wt_tcw2[index_old];
277 for (i = 0; i < block_size; i++) {
278 for (j = 0; j < block_size; j++) {
279 for (k = 0; k < block_size; k++) {
281 xx_o + i, wt_res_old[0], yy_o + j, wt_res_old[1], zz_o + k);
285 n_wt_dens[big_index_new] = o_wt_dens[big_index_old];
286 if (n_wt_flame && o_wt_flame) {
287 n_wt_flame[big_index_new] = o_wt_flame[big_index_old];
288 n_wt_fuel[big_index_new] = o_wt_fuel[big_index_old];
289 n_wt_react[big_index_new] = o_wt_react[big_index_old];
291 if (n_wt_r && o_wt_r) {
292 n_wt_r[big_index_new] = o_wt_r[big_index_old];
293 n_wt_g[big_index_new] = o_wt_g[big_index_old];
294 n_wt_b[big_index_new] = o_wt_b[big_index_old];
301 n_dens[index_new] = o_dens[index_old];
303 if (n_heat && o_heat) {
304 n_heat[index_new] = o_heat[index_old];
307 if (n_fuel && o_fuel) {
308 n_flame[index_new] = o_flame[index_old];
309 n_fuel[index_new] = o_fuel[index_old];
310 n_react[index_new] = o_react[index_old];
314 n_r[index_new] = o_r[index_old];
315 n_g[index_new] = o_g[index_old];
316 n_b[index_new] = o_b[index_old];
318 n_vx[index_new] = o_vx[index_old];
319 n_vy[index_new] = o_vy[index_old];
320 n_vz[index_new] = o_vz[index_old];
416 bool init_resolution)
419 float min[3] = {FLT_MAX, FLT_MAX, FLT_MAX},
max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX};
428 for (i = 0; i < me->
totvert; i++) {
435 fds->
dx = 1.0f / res;
439 if (init_resolution) {
444 for (i = 0; i < 3; i++) {
453 if (!init_resolution || (
size[0] < FLT_EPSILON) || (
size[1] < FLT_EPSILON) ||
454 (
size[2] < FLT_EPSILON)) {
460 scale = res /
size[0];
467 scale = res /
size[1];
474 scale = res /
size[2];
498 static bool BKE_fluid_modifier_init(
507 manta_set_domain_from_mesh(fds, ob, me,
true);
509 update_final_gravity(fds,
scene);
521 res[0] = res[1] = res[2] = 1;
538 fmd->
time = scene_framenr;
547 fmd->
time = scene_framenr;
554 fmd->
time = scene_framenr;
562 static float calc_voxel_transp(
563 float *
result,
const float *input,
int res[3],
int *pixel,
float *t_ray,
float correct);
564 static void update_distances(
int index,
567 const float ray_start[3],
568 float surface_thickness,
569 bool use_plane_init);
571 static int get_light(
ViewLayer *view_layer,
float *light)
577 for (base_tmp =
FIRSTBASE(view_layer); base_tmp; base_tmp = base_tmp->
next) {
598 const float *min_vel,
599 const float *max_vel,
603 for (
int i = 0; i < 3; i++) {
610 if (min_vel && min_vel[i] < 0.0f) {
611 min[i] += (int)
floor(min_vel[i] * dt);
613 if (max_vel && max_vel[i] > 0.0f) {
614 max[i] += (int)
ceil(max_vel[i] * dt);
623 static bool is_static_object(
Object *ob)
628 for (; md; md = md->
next) {
656 typedef struct FluidObjectBB {
661 int min[3],
max[3], res[3];
662 int hmin[3], hmax[3], hres[3];
663 int total_cells, valid;
666 static void bb_boundInsert(FluidObjectBB *bb,
const float point[3])
671 bb->min[i] = (int)
floor(point[i]);
672 bb->max[i] = (int)
ceil(point[i]);
678 if (point[i] < bb->min[i]) {
679 bb->min[i] = (int)
floor(point[i]);
681 if (point[i] > bb->max[i]) {
682 bb->max[i] = (int)
ceil(point[i]);
688 static void bb_allocateData(FluidObjectBB *bb,
bool use_velocity,
bool use_influence)
692 for (i = 0; i < 3; i++) {
693 res[i] = bb->max[i] - bb->min[i];
698 bb->total_cells = res[0] * res[1] * res[2];
701 bb->numobjs =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_numobjs");
703 bb->influence =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_influence");
706 bb->velocity =
MEM_calloc_arrayN(bb->total_cells,
sizeof(
float[3]),
"fluid_bb_velocity");
709 bb->distances =
MEM_malloc_arrayN(bb->total_cells,
sizeof(
float),
"fluid_bb_distances");
710 copy_vn_fl(bb->distances, bb->total_cells, FLT_MAX);
715 static void bb_freeData(FluidObjectBB *bb)
731 static void bb_combineMaps(FluidObjectBB *
output,
740 memcpy(&bb1,
output,
sizeof(FluidObjectBB));
741 memset(
output, 0,
sizeof(FluidObjectBB));
743 for (i = 0; i < 3; i++) {
745 output->min[i] =
MIN2(bb1.min[i], bb2->min[i]);
746 output->max[i] =
MAX2(bb1.max[i], bb2->max[i]);
749 output->min[i] = bb2->min[i];
750 output->max[i] = bb2->max[i];
754 bb_allocateData(
output, (bb1.velocity || bb2->velocity), (bb1.influence || bb2->influence));
757 for (
x =
output->min[0]; x < output->
max[0];
x++) {
758 for (
y =
output->min[1]; y < output->
max[1];
y++) {
759 for (
z =
output->min[2]; z < output->
max[2];
z++) {
767 if (
x >= bb1.min[0] &&
x < bb1.max[0] &&
y >= bb1.min[1] &&
y < bb1.max[1] &&
768 z >= bb1.min[2] &&
z < bb1.max[2]) {
770 x - bb1.min[0], bb1.res[0],
y - bb1.min[1], bb1.res[1],
z - bb1.min[2]);
773 output->numobjs[index_out] = bb1.numobjs[index_in];
774 if (
output->influence && bb1.influence) {
775 output->influence[index_out] = bb1.influence[index_in];
777 output->distances[index_out] = bb1.distances[index_in];
778 if (
output->velocity && bb1.velocity) {
784 if (
x >= bb2->min[0] && x < bb2->
max[0] &&
y >= bb2->min[1] && y < bb2->
max[1] &&
785 z >= bb2->min[2] && z < bb2->
max[2]) {
787 x - bb2->min[0], bb2->res[0],
y - bb2->min[1], bb2->res[1],
z - bb2->min[2]);
790 output->numobjs[index_out] =
MAX2(bb2->numobjs[index_in],
output->numobjs[index_out]);
791 if (
output->influence && bb2->influence) {
793 output->influence[index_out] += bb2->influence[index_in] * sample_size;
796 output->influence[index_out] =
MAX2(bb2->influence[index_in],
797 output->influence[index_out]);
800 output->distances[index_out] =
MIN2(bb2->distances[index_in],
801 output->distances[index_out]);
802 if (
output->velocity && bb2->velocity) {
804 output->velocity[index_out * 3] = ADD_IF_LOWER(
output->velocity[index_out * 3],
805 bb2->velocity[index_in * 3]);
806 output->velocity[index_out * 3 + 1] = ADD_IF_LOWER(
output->velocity[index_out * 3 + 1],
807 bb2->velocity[index_in * 3 + 1]);
808 output->velocity[index_out * 3 + 2] = ADD_IF_LOWER(
output->velocity[index_out * 3 + 2],
809 bb2->velocity[index_in * 3 + 2]);
828 float src_distance_value,
830 float src_numobjs_value,
832 float const src_vel_value[3],
839 dest_phi_in[index] =
MIN2(src_distance_value, dest_phi_in[index]);
843 if (dest_numobjs && src_numobjs_value > 0) {
844 dest_numobjs[index] += 1;
848 if (dest_vel_x && src_numobjs_value > 0) {
849 dest_vel_x[index] += src_vel_value[0];
850 dest_vel_y[index] += src_vel_value[1];
851 dest_vel_z[index] += src_vel_value[2];
862 const float ray_start[3],
863 const float *vert_vel,
872 const float surface_distance = 1.732;
873 nearest.
dist_sq = surface_distance * surface_distance;
883 v1 = mloop[mlooptri[f_index].
tri[0]].
v;
884 v2 = mloop[mlooptri[f_index].
tri[1]].
v;
885 v3 = mloop[mlooptri[f_index].
tri[2]].
v;
897 float abs_hit_vel[3];
903 copy_v3_v3(abs_vel, &velocity_map[index * 3]);
908 velocity_map[index * 3] = (velocity_map[index * 3] + hit_vel[0]) * 0.5f;
909 velocity_map[index * 3 + 1] = (velocity_map[index * 3 + 1] + hit_vel[1]) * 0.5f;
910 velocity_map[index * 3 + 2] = (velocity_map[index * 3 + 2] + hit_vel[2]) * 0.5f;
913 velocity_map[index * 3] = hit_vel[0];
914 velocity_map[index * 3 + 1] = hit_vel[1];
915 velocity_map[index * 3 + 2] = hit_vel[2];
918 velocity_map[index * 3] =
MIN2(abs_hit_vel[0], abs_vel[0]);
919 velocity_map[index * 3 + 1] =
MIN2(abs_hit_vel[1], abs_vel[1]);
920 velocity_map[index * 3 + 2] =
MIN2(abs_hit_vel[2], abs_vel[2]);
924 velocity_map[index * 3] =
MAX2(abs_hit_vel[0], abs_vel[0]);
925 velocity_map[index * 3 + 1] =
MAX2(abs_hit_vel[1], abs_vel[1]);
926 velocity_map[index * 3 + 2] =
MAX2(abs_hit_vel[2], abs_vel[2]);
931 velocity_map[index * 3] = hit_vel[0];
932 velocity_map[index * 3 + 1] = hit_vel[1];
933 velocity_map[index * 3 + 2] = hit_vel[2];
936 printf(
"setting effector object vel: [%f, %f, %f]\n", hit_vel[0], hit_vel[1], hit_vel[2]);
950 typedef struct ObstaclesFromDMData {
963 } ObstaclesFromDMData;
965 static void obstacles_from_mesh_task_cb(
void *__restrict userdata,
969 ObstaclesFromDMData *
data = userdata;
970 FluidObjectBB *bb =
data->bb;
972 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
973 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
975 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
976 const float ray_start[3] = {(
float)
x + 0.5f, (
float)
y + 0.5f, (
float)
z + 0.5f};
979 update_distances(index,
983 data->fes->surface_distance,
999 if (bb->distances[index] < 0) {
1000 bb->numobjs[index]++;
1006 static void obstacles_from_mesh(
Object *coll_ob,
1020 float *vert_vel =
NULL;
1021 bool has_velocity =
false;
1025 int min[3],
max[3], res[3];
1041 vert_vel =
MEM_callocN(
sizeof(
float[3]) * numverts,
"manta_obs_velocity");
1052 has_velocity =
true;
1057 for (i = 0; i < numverts; i++) {
1063 manta_pos_to_cell(fds, mvert[i].co);
1081 bb_boundInsert(bb, mvert[i].co);
1086 int bounds_margin = (int)
ceil(5.196);
1087 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
1088 bb_allocateData(bb,
true,
false);
1091 for (i = 0; i < 3; i++) {
1092 min[i] = bb->min[i];
1093 max[i] = bb->max[i];
1094 res[i] = bb->res[i];
1101 ObstaclesFromDMData
data = {
1105 .mlooptri = looptri,
1108 .has_velocity = has_velocity,
1109 .vert_vel = vert_vel,
1146 int coll_ob_array_len)
1153 active_fields &= ~prev_flags;
1156 for (coll_index = 0; coll_index < coll_ob_array_len; coll_index++) {
1157 Object *coll_ob = coll_ob_array[coll_index];
1186 static bool escape_effectorobject(
Object *flowobj,
1191 bool is_static = is_static_object(flowobj);
1203 if (is_static && !is_first_frame && !is_resume) {
1209 static void compute_obstaclesemission(
Scene *
scene,
1210 FluidObjectBB *bb_maps,
1218 float time_per_frame)
1223 for (
int effec_index = 0; effec_index < numeffecobjs; effec_index++) {
1224 Object *effecobj = effecobjs[effec_index];
1237 FluidObjectBB *bb = &bb_maps[effec_index];
1240 if (escape_effectorobject(effecobj, fds, fes, frame)) {
1246 if (is_first_frame) {
1251 float sample_size = 1.0f / (
float)(subframes + 1);
1252 float subframe_dt = dt * sample_size;
1255 for (
int subframe = 0; subframe <= subframes; subframe++) {
1258 FluidObjectBB bb_temp = {
NULL};
1262 if ((subframe < subframes || time_per_frame + dt + FLT_EPSILON < frame_length) &&
1264 scene->
r.
subframe = (time_per_frame + (subframe + 1.0f) * subframe_dt) / frame_length;
1276 "effector: frame (is first: %d): %d // scene current frame: %d // scene current "
1292 obstacles_from_mesh(effecobj, fds, fes, &bb_temp, subframe_dt);
1295 obstacles_from_mesh(effecobj, fds, fes, bb, subframe_dt);
1302 bb_combineMaps(bb, &bb_temp, 0, 0.0f);
1303 bb_freeData(&bb_temp);
1314 float time_per_frame,
1319 FluidObjectBB *bb_maps =
NULL;
1321 uint numeffecobjs = 0;
1329 update_obstacleflags(fds, effecobjs, numeffecobjs);
1330 ensure_obstaclefields(fds);
1333 bb_maps =
MEM_callocN(
sizeof(
struct FluidObjectBB) * numeffecobjs,
"fluid_effector_bb_maps");
1336 compute_obstaclesemission(
scene,
1363 for (
z = 0;
z < fds->
res[0] * fds->
res[1] * fds->
res[2];
z++) {
1371 if (phi_obsstatic_in && (is_first_frame || use_adaptivedomain)) {
1377 if (num_obstacles) {
1378 num_obstacles[
z] = 0;
1383 if (vel_x && vel_y && vel_z) {
1388 if (vel_x_guide && vel_y_guide && vel_z_guide) {
1389 vel_x_guide[
z] = 0.0f;
1390 vel_y_guide[
z] = 0.0f;
1391 vel_z_guide[
z] = 0.0f;
1396 for (
int effec_index = 0; effec_index < numeffecobjs; effec_index++) {
1397 Object *effecobj = effecobjs[effec_index];
1409 bool is_static = is_static_object(effecobj) && !use_adaptivedomain;
1420 FluidObjectBB *bb = &bb_maps[effec_index];
1421 float *velocity_map = bb->velocity;
1422 float *numobjs_map = bb->numobjs;
1423 float *distance_map = bb->distances;
1425 int gx, gy, gz, ex, ey, ez, dx, dy, dz;
1426 size_t e_index, d_index;
1429 for (gx = bb->min[0]; gx < bb->
max[0]; gx++) {
1430 for (gy = bb->min[1]; gy < bb->
max[1]; gy++) {
1431 for (gz = bb->min[2]; gz < bb->
max[2]; gz++) {
1433 ex = gx - bb->min[0];
1434 ey = gy - bb->min[1];
1435 ez = gz - bb->min[2];
1444 if (dx < 0 || dy < 0 || dz < 0 || dx >= fds->
res[0] || dy >= fds->
res[1] ||
1445 dz >= fds->
res[2]) {
1450 float *levelset = ((is_first_frame || is_resume) && is_static) ? phi_obsstatic_in :
1452 apply_effector_fields(fes,
1454 distance_map[e_index],
1456 numobjs_map[e_index],
1458 &velocity_map[e_index * 3],
1464 apply_effector_fields(fes,
1466 distance_map[e_index],
1468 numobjs_map[e_index],
1470 &velocity_map[e_index * 3],
1494 typedef struct EmitFromParticlesData {
1499 float *particle_vel;
1504 } EmitFromParticlesData;
1506 static void emit_from_particles_task_cb(
void *__restrict userdata,
1510 EmitFromParticlesData *
data = userdata;
1512 FluidObjectBB *bb =
data->bb;
1514 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
1515 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
1517 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
1518 const float ray_start[3] = {((
float)
x) + 0.5f, ((
float)
y) + 0.5f, ((
float)
z) + 0.5f};
1521 KDTreeNearest_3d nearest;
1522 const float range =
data->solid +
data->smooth;
1523 BLI_kdtree_3d_find_nearest(
data->tree, ray_start, &nearest);
1525 if (nearest.dist < range) {
1526 bb->influence[index] = (nearest.dist <
data->solid) ?
1528 (1.0f - (nearest.dist -
data->solid) /
data->smooth);
1532 &bb->velocity[index * 3], &
data->particle_vel[nearest.index * 3], ffs->
vel_multi);
1539 static void emit_from_particles(
Object *flow_ob,
1552 float *particle_pos;
1553 float *particle_vel;
1554 int totpart = psys->
totpart, totchild;
1556 int valid_particles = 0;
1557 int bounds_margin = 1;
1561 const float smooth = 0.5f;
1590 particle_pos =
MEM_callocN(
sizeof(
float[3]) * (totpart + totchild),
1591 "manta_flow_particles_pos");
1592 particle_vel =
MEM_callocN(
sizeof(
float[3]) * (totpart + totchild),
1593 "manta_flow_particles_vel");
1598 bounds_margin = (int)
ceil(solid + smooth);
1602 for (p = 0; p < totpart + totchild; p++) {
1625 pos = &particle_pos[valid_particles * 3];
1627 manta_pos_to_cell(fds,
pos);
1630 vel = &particle_vel[valid_particles * 3];
1635 BLI_kdtree_3d_insert(
tree, valid_particles,
pos);
1639 bb_boundInsert(bb,
pos);
1644 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
1648 for (p = 0; p < valid_particles; p++) {
1655 cell[0] =
floor(particle_pos[p * 3]) - bb->min[0];
1656 cell[1] =
floor(particle_pos[p * 3 + 1]) - bb->min[1];
1657 cell[2] =
floor(particle_pos[p * 3 + 2]) - bb->min[2];
1659 for (i = 0; i < 3; i++) {
1660 if ((cell[i] > bb->res[i] - 1) || (cell[i] < 0)) {
1669 index =
manta_get_index(cell[0], bb->res[0], cell[1], bb->res[1], cell[2]);
1671 bb->influence[index] = 1.0f;
1678 else if (valid_particles > 0) {
1679 int min[3],
max[3], res[3];
1682 for (
int i = 0; i < 3; i++) {
1683 min[i] = bb->min[i];
1684 max[i] = bb->max[i];
1685 res[i] = bb->res[i];
1688 BLI_kdtree_3d_balance(
tree);
1690 EmitFromParticlesData
data = {
1694 .particle_vel = particle_vel,
1709 BLI_kdtree_3d_free(
tree);
1724 static void update_distances(
int index,
1725 float *distance_map,
1727 const float ray_start[3],
1728 float surface_thickness,
1729 bool use_plane_init)
1734 if (use_plane_init) {
1740 const float surface_distance = 1.732;
1741 nearest.
dist_sq = surface_distance *
1745 if (surface_thickness) {
1746 nearest.
dist_sq += surface_thickness;
1754 min_dist = (-1.0f) *
fabsf(min_dist);
1761 float ray_dirs[26][3] = {
1762 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, 0.0f},
1763 {0.0f, -1.0f, 0.0f}, {0.0f, 0.0f, -1.0f}, {1.0f, 1.0f, 0.0f}, {1.0f, -1.0f, 0.0f},
1764 {-1.0f, 1.0f, 0.0f}, {-1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 1.0f}, {1.0f, 0.0f, -1.0f},
1765 {-1.0f, 0.0f, 1.0f}, {-1.0f, 0.0f, -1.0f}, {0.0f, 1.0f, 1.0f}, {0.0f, 1.0f, -1.0f},
1766 {0.0f, -1.0f, 1.0f}, {0.0f, -1.0f, -1.0f}, {1.0f, 1.0f, 1.0f}, {1.0f, -1.0f, 1.0f},
1767 {-1.0f, 1.0f, 1.0f}, {-1.0f, -1.0f, 1.0f}, {1.0f, 1.0f, -1.0f}, {1.0f, -1.0f, -1.0f},
1768 {-1.0f, 1.0f, -1.0f}, {-1.0f, -1.0f, -1.0f}};
1773 int miss_cnt = 0, dir_cnt = 0;
1775 for (
int i = 0; i <
ARRAY_SIZE(ray_dirs); i++) {
1777 hit_tree.
index = -1;
1791 if (hit_tree.
index == -1) {
1798 if (
dot_v3v3(ray_dirs[i], hit_tree.
no) <= 0) {
1802 if (hit_tree.
dist < min_dist) {
1803 min_dist = hit_tree.
dist;
1809 if (!(miss_cnt > 0 || dir_cnt ==
ARRAY_SIZE(ray_dirs))) {
1810 min_dist = (-1.0f) *
fabsf(min_dist);
1814 if (surface_thickness) {
1815 min_dist -= surface_thickness;
1820 distance_map[index] =
MIN2(distance_map[index], min_dist);
1831 float *influence_map,
1832 float *velocity_map,
1834 const int base_res[3],
1835 const float global_size[3],
1836 const float flow_center[3],
1838 const float ray_start[3],
1839 const float *vert_vel,
1847 float ray_dir[3] = {1.0f, 0.0f, 0.0f};
1851 float volume_factor = 0.0f;
1860 const float surface_distance = 1.732;
1861 nearest.
dist_sq = surface_distance * surface_distance;
1869 float emission_strength = (is_gas_flow) ? 0.0f : 1.0f;
1880 float dot = ray_dir[0] * hit.
no[0] + ray_dir[1] * hit.
no[1] + ray_dir[2] * hit.
no[2];
1896 if (hit.
index != -1) {
1907 int v1,
v2, v3, f_index = nearest.
index;
1908 float n1[3], n2[3], n3[3], hit_normal[3];
1911 v1 = mloop[mlooptri[f_index].
tri[0]].
v;
1912 v2 = mloop[mlooptri[f_index].
tri[1]].
v;
1913 v3 = mloop[mlooptri[f_index].
tri[2]].
v;
1921 CLAMP(emission_strength, 0.0f, 1.0f);
1922 emission_strength =
pow(1.0f - emission_strength, 0.5f);
1925 emission_strength = 0.0f;
1929 if (defgrp_index != -1 && dvert) {
1933 emission_strength *= weight_mask;
1938 float tex_co[3] = {0};
1942 tex_co[0] = ((
x - flow_center[0]) / base_res[0]) / ffs->
texture_size;
1943 tex_co[1] = ((
y - flow_center[1]) / base_res[1]) / ffs->
texture_size;
1944 tex_co[2] = ((
z - flow_center[2]) / base_res[2] - ffs->
texture_offset) /
1949 uv[0] = mloopuv[mlooptri[f_index].
tri[0]].
uv;
1950 uv[1] = mloopuv[mlooptri[f_index].
tri[1]].
uv;
1951 uv[2] = mloopuv[mlooptri[f_index].
tri[2]].
uv;
1956 tex_co[0] = tex_co[0] * 2.0f - 1.0f;
1957 tex_co[1] = tex_co[1] * 2.0f - 1.0f;
1962 emission_strength *= texres.
tin;
1978 velocity_map[index * 3] += hit_normal[0] * ffs->
vel_normal;
1979 velocity_map[index * 3 + 1] += hit_normal[1] * ffs->
vel_normal;
1980 velocity_map[index * 3 + 2] += hit_normal[2] * ffs->
vel_normal;
1986 hit_vel, &vert_vel[
v1 * 3], &vert_vel[
v2 * 3], &vert_vel[v3 * 3], weights);
1987 velocity_map[index * 3] += hit_vel[0] * ffs->
vel_multi;
1988 velocity_map[index * 3 + 1] += hit_vel[1] * ffs->
vel_multi;
1989 velocity_map[index * 3 + 2] += hit_vel[2] * ffs->
vel_multi;
1992 printf(
"adding flow object vel: [%f, %f, %f]\n", hit_vel[0], hit_vel[1], hit_vel[2]);
1996 float convert_vel[3];
1998 float time_mult = 1.0 / (25.0f *
DT_DEFAULT);
1999 float size_mult =
MAX3(base_res[0], base_res[1], base_res[2]) /
2000 MAX3(global_size[0], global_size[1], global_size[2]);
2003 velocity_map[index * 3] += convert_vel[0];
2004 velocity_map[index * 3 + 1] += convert_vel[1];
2005 velocity_map[index * 3 + 2] += convert_vel[2];
2007 printf(
"initial vel: [%f, %f, %f]\n",
2008 velocity_map[index * 3],
2009 velocity_map[index * 3 + 1],
2010 velocity_map[index * 3 + 2]);
2016 influence_map[index] =
MAX2(volume_factor, emission_strength);
2019 typedef struct EmitFromDMData {
2039 static void emit_from_mesh_task_cb(
void *__restrict userdata,
2043 EmitFromDMData *
data = userdata;
2044 FluidObjectBB *bb =
data->bb;
2046 for (
int x =
data->min[0]; x < data->
max[0];
x++) {
2047 for (
int y =
data->min[1]; y < data->
max[1];
y++) {
2049 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
2050 const float ray_start[3] = {((
float)
x) + 0.5f, ((
float)
y) + 0.5f, ((
float)
z) + 0.5f};
2056 sample_mesh(
data->ffs,
2064 data->fds->base_res,
2065 data->fds->global_size,
2079 update_distances(index,
2083 data->ffs->surface_distance,
2089 static void emit_from_mesh(
2102 float *vert_vel =
NULL;
2103 bool has_velocity =
false;
2106 float flow_center[3] = {0};
2107 int min[3],
max[3], res[3];
2128 vert_vel =
MEM_callocN(
sizeof(
float[3]) * numverts,
"manta_flow_velocity");
2138 has_velocity =
true;
2143 for (i = 0; i < numverts; i++) {
2148 manta_pos_to_cell(fds, mvert[i].co);
2169 bb_boundInsert(bb, mvert[i].co);
2172 manta_pos_to_cell(fds, flow_center);
2176 int bounds_margin = (int)
ceil(5.196);
2177 clamp_bounds_in_domain(fds, bb->min, bb->max,
NULL,
NULL, bounds_margin, dt);
2181 for (i = 0; i < 3; i++) {
2182 min[i] = bb->min[i];
2183 max[i] = bb->max[i];
2184 res[i] = bb->res[i];
2191 EmitFromDMData
data = {
2196 .mlooptri = mlooptri,
2199 .defgrp_index = defgrp_index,
2202 .has_velocity = has_velocity,
2203 .vert_vel = vert_vel,
2204 .flow_center = flow_center,
2234 static void adaptive_domain_adjust(
2238 int new_shift[3] = {0};
2240 float frame_shift_f[3];
2241 float ob_loc[3] = {0};
2249 frame_shift_f[0] = frame_shift_f[0] / fds->
cell_size[0];
2250 frame_shift_f[1] = frame_shift_f[1] / fds->
cell_size[1];
2251 frame_shift_f[2] = frame_shift_f[2] / fds->
cell_size[2];
2273 int min[3] = {32767, 32767, 32767},
max[3] = {-32767, -32767, -32767}, res[3];
2274 int total_cells = 1, res_changed = 0, shift_changed = 0;
2275 float min_vel[3], max_vel[3];
2293 for (
x = fds->
res_min[0]; x < fds->res_max[0];
x++) {
2294 for (
y = fds->
res_min[1]; y < fds->res_max[1];
y++) {
2295 for (
z = fds->
res_min[2]; z < fds->res_max[2];
z++) {
2296 int xn =
x - new_shift[0];
2297 int yn =
y - new_shift[1];
2298 int zn =
z - new_shift[2];
2303 if (xn >=
min[0] && xn <=
max[0] && yn >=
min[1] && yn <=
max[1] && zn >=
min[2] &&
2313 max_den = (fuel) ?
MAX2(density[index], fuel[index]) : density[index];
2319 int xx = (
x - fds->
res_min[0]) * block_size;
2320 int yy = (
y - fds->
res_min[1]) * block_size;
2321 int zz = (
z - fds->
res_min[2]) * block_size;
2323 for (i = 0; i < block_size; i++) {
2324 for (j = 0; j < block_size; j++) {
2325 for (k = 0; k < block_size; k++) {
2326 int big_index =
manta_get_index(xx + i, wt_res[0], yy + j, wt_res[1], zz + k);
2327 float den = (bigfuel) ?
MAX2(bigdensity[big_index], bigfuel[big_index]) :
2328 bigdensity[big_index];
2329 if (den > max_den) {
2360 if (min_vel[0] > vx[index]) {
2361 min_vel[0] = vx[index];
2363 if (min_vel[1] > vy[index]) {
2364 min_vel[1] = vy[index];
2366 if (min_vel[2] > vz[index]) {
2367 min_vel[2] = vz[index];
2369 if (max_vel[0] < vx[index]) {
2370 max_vel[0] = vx[index];
2372 if (max_vel[1] < vy[index]) {
2373 max_vel[1] = vy[index];
2375 if (max_vel[2] < vz[index]) {
2376 max_vel[2] = vz[index];
2383 for (
int i = 0; i < numflowobj; i++) {
2384 FluidObjectBB *bb = &bb_maps[i];
2386 for (
x = bb->min[0]; x < bb->
max[0];
x++) {
2387 for (
y = bb->min[1]; y < bb->
max[1];
y++) {
2388 for (
z = bb->min[2]; z < bb->
max[2];
z++) {
2390 x - bb->min[0], bb->res[0],
y - bb->min[1], bb->res[1],
z - bb->min[2]);
2391 float max_den = bb->influence[index];
2422 for (
int i = 0; i < 3; i++) {
2424 res[i] =
max[i] -
min[i];
2425 total_cells *= res[i];
2434 for (j = 0; j < 3; j++) {
2448 if (res_changed || shift_changed) {
2463 BLI_INLINE void apply_outflow_fields(
int index,
2464 float distance_value,
2477 phiout[index] =
MIN2(distance_value, phiout[index]);
2482 density[index] = 0.0f;
2489 react[index] = 0.0f;
2492 color_r[index] = 0.0f;
2493 color_g[index] = 0.0f;
2494 color_b[index] = 0.0f;
2499 float emission_value,
2500 float distance_value,
2503 const float *density,
2511 const float *color_r,
2513 const float *color_g,
2515 const float *color_b,
2522 phi_in[index] =
MIN2(distance_value, phi_in[index]);
2528 emission_in[index] =
MAX2(emission_value, emission_in[index]);
2533 float dens_old = (density) ? density[index] : 0.0;
2536 float fuel_flow = (fuel) ? emission_value * ffs->
fuel_amount : 0.0f;
2538 if (heat && heat_in) {
2539 if (emission_value > 0.0f) {
2540 heat_in[index] = ADD_IF_LOWER(heat[index], ffs->
temperature);
2545 if (absolute_flow) {
2546 if (density && density_in) {
2549 density_in[index] =
MAX2(dens_flow, density_in[index]);
2552 if (fuel && fuel_in) {
2555 fuel_in[index] =
MAX2(fuel_flow, fuel_in[index]);
2561 if (density && density_in) {
2563 density_in[index] += dens_flow;
2564 CLAMP(density_in[index], 0.0f, 1.0f);
2567 if (fuel && fuel_in) {
2569 fuel_in[index] += fuel_flow;
2570 CLAMP(fuel_in[index], 0.0f, 10.0f);
2576 if (color_r && color_r_in) {
2578 float total_dens = density[index] / (dens_old + dens_flow);
2579 color_r_in[index] = (color_r[index] + ffs->
color[0] * dens_flow) * total_dens;
2580 color_g_in[index] = (color_g[index] + ffs->
color[1] * dens_flow) * total_dens;
2581 color_b_in[index] = (color_b[index] + ffs->
color[2] * dens_flow) * total_dens;
2586 if (fuel && fuel_in) {
2588 float value = 1.0f -
pow2f(1.0f - emission_value);
2590 if (fuel_in[index] > FLT_EPSILON && value > react[index]) {
2591 float f = fuel_flow / fuel_in[index];
2592 react_in[index] = value * f + (1.0f - f) * react[index];
2593 CLAMP(react_in[index], 0.0f, value);
2633 active_fields &= ~prev_flags;
2636 for (flow_index = 0; flow_index < numflowobj; flow_index++) {
2637 Object *flow_ob = flowobjs[flow_index];
2707 static bool escape_flowsobject(
Object *flowobj,
2713 bool is_static = is_static_object(flowobj);
2732 if (liquid_flow && is_geometry && !is_first_frame) {
2736 if ((liquid_flow && gas_domain) || (gas_flow && liquid_domain)) {
2741 if (liquid_flow && is_static && !is_first_frame && !is_resume && !use_velocity) {
2747 static void compute_flowsemission(
Scene *
scene,
2748 FluidObjectBB *bb_maps,
2756 float time_per_frame)
2761 for (
int flow_index = 0; flow_index < numflowobjs; flow_index++) {
2762 Object *flowobj = flowobjs[flow_index];
2775 FluidObjectBB *bb = &bb_maps[flow_index];
2778 if (escape_flowsobject(flowobj, fds, ffs, frame)) {
2784 if (is_first_frame) {
2789 float sample_size = 1.0f / (
float)(subframes + 1);
2790 float subframe_dt = dt * sample_size;
2793 for (
int subframe = 0; subframe <= subframes; subframe++) {
2795 FluidObjectBB bb_temp = {
NULL};
2798 if ((subframe < subframes || time_per_frame + dt + FLT_EPSILON < frame_length) &&
2800 scene->
r.
subframe = (time_per_frame + (subframe + 1.0f) * subframe_dt) / frame_length;
2813 "flow: frame (is first: %d): %d // scene current frame: %d // scene current subframe: "
2830 emit_from_particles(flowobj, fds, ffs, &bb_temp,
depsgraph,
scene, subframe_dt);
2833 emit_from_particles(flowobj, fds, ffs, bb,
depsgraph,
scene, subframe_dt);
2839 emit_from_mesh(flowobj, fds, ffs, &bb_temp, subframe_dt);
2842 emit_from_mesh(flowobj, fds, ffs, bb, subframe_dt);
2846 printf(
"Error: unknown flow emission source\n");
2854 bb_freeData(&bb_temp);
2861 printf(
"flow: frame: %d // time per frame: %f // frame length: %f // dt: %f\n",
2873 float time_per_frame,
2878 FluidObjectBB *bb_maps =
NULL;
2880 uint numflowobjs = 0;
2888 update_flowsflags(fds, flowobjs, numflowobjs);
2889 ensure_flowsfields(fds);
2892 bb_maps =
MEM_callocN(
sizeof(
struct FluidObjectBB) * numflowobjs,
"fluid_flow_bb_maps");
2895 compute_flowsemission(
scene,
2908 adaptive_domain_adjust(fds, ob, bb_maps, numflowobjs, dt);
2944 BLI_assert((color_r && color_g && color_b) || (!color_r && !color_g && !color_b));
2945 BLI_assert((color_r_in && color_g_in && color_b_in) ||
2946 (!color_r_in && !color_g_in && !color_b_in));
2947 BLI_assert((velx_initial && vely_initial && velz_initial) ||
2948 (!velx_initial && !vely_initial && !velz_initial));
2952 for (
z = 0;
z < fds->
res[0] * fds->
res[1] * fds->
res[2];
z++) {
2954 if (phistatic_in && is_first_frame) {
2961 if (phioutstatic_in && is_first_frame) {
2969 density_in[
z] = density[
z];
2972 heat_in[
z] = heat[
z];
2974 if (color_r_in && color_g_in && color_b_in) {
2975 color_r_in[
z] = color_r[
z];
2976 color_g_in[
z] = color_b[
z];
2977 color_b_in[
z] = color_g[
z];
2980 fuel_in[
z] = fuel[
z];
2981 react_in[
z] = react[
z];
2984 emission_in[
z] = 0.0f;
2986 if (velx_initial && vely_initial && velz_initial) {
2987 velx_initial[
z] = 0.0f;
2988 vely_initial[
z] = 0.0f;
2989 velz_initial[
z] = 0.0f;
2998 for (
int flow_index = 0; flow_index < numflowobjs; flow_index++) {
2999 Object *flowobj = flowobjs[flow_index];
3015 bool is_static = is_static_object(flowobj) &&
3018 FluidObjectBB *bb = &bb_maps[flow_index];
3019 float *velocity_map = bb->velocity;
3020 float *emission_map = bb->influence;
3021 float *distance_map = bb->distances;
3023 int gx, gy, gz, ex, ey, ez, dx, dy, dz;
3024 size_t e_index, d_index;
3027 for (gx = bb->min[0]; gx < bb->
max[0]; gx++) {
3028 for (gy = bb->min[1]; gy < bb->
max[1]; gy++) {
3029 for (gz = bb->min[2]; gz < bb->
max[2]; gz++) {
3031 ex = gx - bb->min[0];
3032 ey = gy - bb->min[1];
3033 ez = gz - bb->min[2];
3042 if (dx < 0 || dy < 0 || dz < 0 || dx >= fds->
res[0] || dy >= fds->
res[1] ||
3043 dz >= fds->
res[2]) {
3049 float *levelset = ((is_first_frame || is_resume) && is_static) ? phioutstatic_in :
3051 apply_outflow_fields(d_index,
3052 distance_map[e_index],
3063 else if (is_geometry && !is_first_frame) {
3064 apply_inflow_fields(ffs,
3086 else if (is_geometry || is_inflow) {
3087 float *levelset = ((is_first_frame || is_resume) && is_static && !is_geometry) ?
3090 apply_inflow_fields(ffs,
3091 emission_map[e_index],
3092 distance_map[e_index],
3113 float vel_initial[3];
3114 vel_initial[0] = velx_initial[d_index];
3115 vel_initial[1] = vely_initial[d_index];
3116 vel_initial[2] = velz_initial[d_index];
3118 float vel_map_strength =
len_squared_v3(velocity_map + 3 * e_index);
3119 if (vel_map_strength > vel_initial_strength) {
3120 velx_initial[d_index] = velocity_map[e_index * 3];
3121 vely_initial[d_index] = velocity_map[e_index * 3 + 1];
3122 velz_initial[d_index] = velocity_map[e_index * 3 + 2];
3139 typedef struct UpdateEffectorsData {
3154 } UpdateEffectorsData;
3156 static void update_effectors_task_cb(
void *__restrict userdata,
3160 UpdateEffectorsData *
data = userdata;
3163 for (
int y = 0;
y < fds->
res[1];
y++) {
3164 for (
int z = 0;
z < fds->
res[2];
z++) {
3167 float voxel_center[3] = {0, 0, 0}, vel[3] = {0, 0, 0}, retvel[3] = {0, 0, 0};
3170 if ((
data->fuel &&
MAX2(
data->density[index],
data->fuel[index]) < FLT_EPSILON) ||
3171 (
data->density &&
data->density[index] < FLT_EPSILON) ||
3172 (
data->phi_obs_in &&
data->phi_obs_in[index] < 0.0f) ||
3173 data->flags[index] & 2)
3179 vel[0] =
data->velocity_x[index];
3180 vel[1] =
data->velocity_y[index];
3181 vel[2] =
data->velocity_z[index];
3208 CLAMP3(retvel, -1.0f, 1.0f);
3209 data->force_x[index] = retvel[0];
3210 data->force_y[index] = retvel[1];
3211 data->force_z[index] = retvel[2];
3215 printf(
"setting force: [%f, %f, %f]\n",
3216 data->force_x[index],
3217 data->force_y[index],
3218 data->force_z[index]);
3224 static void update_effectors(
3234 UpdateEffectorsData
data;
3237 data.effectors = effectors;
3269 float cell_size_scaled[3];
3274 MPoly mp_example = {0};
3275 mpoly = orgmesh->
mpoly;
3277 mp_example = *mpoly;
3280 const short mp_mat_nr = mp_example.
mat_nr;
3281 const char mp_flag = mp_example.
flag;
3284 int num_verts, num_normals, num_faces;
3296 printf(
"num_verts: %d, num_normals: %d, num_faces: %d\n", num_verts, num_normals, num_faces);
3299 if (!num_verts || !num_faces) {
3310 if (use_speedvectors) {
3340 co_scale[0] = max_size / ob->
scale[0];
3341 co_scale[1] = max_size / ob->
scale[1];
3342 co_scale[2] = max_size / ob->
scale[2];
3345 co_offset[0] = (fds->
p0[0] + fds->
p1[0]) / 2.0f;
3346 co_offset[1] = (fds->
p0[1] + fds->
p1[1]) / 2.0f;
3347 co_offset[2] = (fds->
p0[2] + fds->
p1[2]) / 2.0f;
3353 for (i = 0, no_s =
normals; i < num_verts && i < num_normals; i++, mverts++, no_s += 3) {
3373 printf(
"mverts->co[0]: %f, mverts->co[1]: %f, mverts->co[2]: %f\n",
3387 printf(
"no_s[0]: %d, no_s[1]: %d, no_s[2]: %d\n", no_s[0], no_s[1], no_s[2]);
3390 if (use_speedvectors) {
3396 printf(
"velarray[%d].vel[0]: %f, velarray[%d].vel[1]: %f, velarray[%d].vel[2]: %f\n",
3402 velarray[i].vel[2]);
3408 for (i = 0; i < num_faces; i++, mpolys++, mloops += 3) {
3410 mpolys->mat_nr = mp_mat_nr;
3411 mpolys->flag = mp_flag;
3413 mpolys->loopstart = i * 3;
3414 mpolys->totloop = 3;
3421 printf(
"mloops[0].v: %d, mloops[1].v: %d, mloops[2].v: %d\n",
3451 float ob_loc[3] = {0};
3452 float ob_cache_loc[3] = {0};
3508 ml = &mloops[0 * 4];
3517 ml = &mloops[1 * 4];
3526 ml = &mloops[2 * 4];
3535 ml = &mloops[3 * 4];
3544 ml = &mloops[4 * 4];
3553 ml = &mloops[5 * 4];
3570 for (
int i = 0; i < num_verts; i++) {
3580 static int manta_step(
3584 float dt, frame_length, time_total, time_total_old;
3585 float time_per_frame;
3586 bool init_resolution =
true;
3601 manta_set_domain_from_mesh(fds, ob, me, init_resolution);
3614 while (time_per_frame + FLT_EPSILON < frame_length) {
3623 update_flowsfluids(
depsgraph,
scene, ob, fds, time_per_frame, frame_length, frame, dt);
3626 if (
G.is_break && !mode_replay) {
3634 update_obstacles(
depsgraph,
scene, ob, fds, time_per_frame, frame_length, frame, dt);
3637 if (
G.is_break && !mode_replay) {
3649 time_per_frame += dt;
3668 static void manta_guiding(
3688 const int scene_framenr)
3690 if (scene_framenr >= fmd->
time) {
3701 if (scene_framenr > fmd->
time) {
3702 fmd->
time = scene_framenr;
3704 else if (scene_framenr < fmd->
time) {
3705 fmd->
time = scene_framenr;
3715 const int scene_framenr)
3717 if (scene_framenr >= fmd->
time) {
3728 if (scene_framenr > fmd->
time) {
3729 fmd->
time = scene_framenr;
3731 else if (scene_framenr < fmd->
time) {
3732 fmd->
time = scene_framenr;
3742 const int scene_framenr)
3750 bool is_startframe, has_advanced;
3752 has_advanced = (scene_framenr == fmd->
time + 1);
3756 bool escape =
false;
3761 if (scene_framenr < fds->cache_frame_start ||
3775 if (scene_framenr < fds->cache_frame_start || scene_framenr > fds->
cache_frame_end) {
3781 if (escape && fds->
fluid) {
3798 update_flowsflags(fds, objs, numobj);
3804 update_obstacleflags(fds, objs, numobj);
3822 CLOG_ERROR(&
LOG,
"Fluid initialization failed. Should not happen!");
3831 if (fmd_parent && fmd_parent->
domain) {
3837 int o_res[3], o_min[3], o_max[3], o_shift[3];
3850 update_final_gravity(fds,
scene);
3852 int next_frame = scene_framenr + 1;
3853 int prev_frame = scene_framenr - 1;
3857 int data_frame = scene_framenr, noise_frame = scene_framenr;
3858 int mesh_frame = scene_framenr, particles_frame = scene_framenr, guide_frame = scene_framenr;
3860 bool with_smoke, with_liquid;
3864 bool drops, bubble, floater;
3870 bool with_script, with_noise, with_mesh, with_particles, with_guide;
3875 with_particles = drops || bubble || floater;
3877 bool has_data, has_noise, has_mesh, has_particles, has_guide, has_config;
3889 ensure_flowsfields(fds);
3890 ensure_obstaclefields(fds);
3893 bool baking_data, baking_noise, baking_mesh, baking_particles, baking_guide;
3900 bool resume_data, resume_noise, resume_mesh, resume_particles, resume_guide;
3907 bool read_cache, bake_cache;
3909 bake_cache = baking_data || baking_noise || baking_mesh || baking_particles || baking_guide;
3911 bool next_data, next_noise, next_mesh, next_particles, next_guide;
3918 bool prev_data, prev_noise, prev_mesh, prev_particles, prev_guide;
3936 if (!baking_data && !baking_noise && !baking_mesh && !baking_particles && !baking_guide) {
3950 if (baking_data && resume_data) {
3951 data_frame = prev_frame;
3953 if (baking_noise && resume_noise) {
3954 noise_frame = prev_frame;
3956 if (baking_mesh && resume_mesh) {
3957 mesh_frame = prev_frame;
3959 if (baking_particles && resume_particles) {
3960 particles_frame = prev_frame;
3962 if (baking_guide && resume_guide) {
3963 guide_frame = prev_frame;
3977 baking_data = !has_data && (is_startframe || prev_data);
3978 if (with_smoke && with_noise) {
3979 baking_noise = !has_noise && (is_startframe || prev_noise);
3981 if (with_liquid && with_mesh) {
3982 baking_mesh = !has_mesh && (is_startframe || prev_mesh);
3984 if (with_liquid && with_particles) {
3985 baking_particles = !has_particles && (is_startframe || prev_particles);
3994 bool read_partial =
false, read_all =
false;
4001 if (with_liquid && with_mesh) {
4002 if (mesh_frame != scene_framenr) {
4014 if (with_liquid && with_particles) {
4015 if (particles_frame != scene_framenr) {
4019 read_partial = !baking_data && !baking_particles && next_particles;
4020 read_all = !read_partial && with_resumable_cache;
4031 if (with_smoke && with_noise) {
4032 if (noise_frame != scene_framenr) {
4039 fds, o_res, fds->
res, o_min, fds->
res_min, o_max, o_shift, fds->
shift);
4042 read_partial = !baking_data && !baking_noise && next_noise;
4043 read_all = !read_partial && with_resumable_cache;
4046 read_partial = !baking_data && !baking_noise && next_data && next_noise;
4047 read_all = !read_partial && with_resumable_cache;
4052 if (data_frame != scene_framenr) {
4063 read_partial = !baking_data && !baking_particles && !baking_mesh && next_data &&
4065 read_all = !read_partial && with_resumable_cache;
4074 if (!baking_data && !baking_noise && !baking_mesh && !baking_particles && !baking_guide) {
4081 baking_guide = !has_guide && (is_startframe || prev_guide);
4083 baking_data = !has_data && (is_startframe || prev_data);
4084 if (with_smoke && with_noise) {
4085 baking_noise = !has_noise && (is_startframe || prev_noise);
4087 if (with_liquid && with_mesh) {
4088 baking_mesh = !has_mesh && (is_startframe || prev_mesh);
4090 if (with_liquid && with_particles) {
4091 baking_particles = !has_particles && (is_startframe || prev_particles);
4095 if (is_startframe || has_advanced) {
4096 bake_cache = baking_data || baking_noise || baking_mesh || baking_particles;
4107 if (with_script && is_startframe) {
4116 if (baking_guide && with_guide) {
4126 if (has_data || baking_data) {
4127 if (baking_noise && with_smoke && with_noise) {
4134 if (baking_mesh && with_liquid && with_mesh) {
4137 if (baking_particles && with_liquid && with_particles) {
4147 fmd->
time = scene_framenr;
4150 static void BKE_fluid_modifier_process(
4156 BKE_fluid_modifier_processFlow(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4159 BKE_fluid_modifier_processEffector(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4162 BKE_fluid_modifier_processDomain(fmd,
depsgraph,
scene, ob, me, scene_framenr);
4171 bool needs_viewport_update =
false;
4192 needs_viewport_update =
true;
4198 bool baking_data, baking_noise, baking_mesh, baking_particles, baking_guide;
4205 if (with_mesh && !baking_data && !baking_noise && !baking_mesh && !baking_particles &&
4207 needs_viewport_update =
true;
4215 if (needs_viewport_update) {
4250 static float calc_voxel_transp(
4251 float *
result,
const float *input,
int res[3],
int *pixel,
float *t_ray,
float correct)
4265 static void bresenham_linie_3D(
int x1,
4278 int dx, dy, dz, i,
l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2;
4289 x_inc = (dx < 0) ? -1 : 1;
4291 y_inc = (dy < 0) ? -1 : 1;
4293 z_inc = (dz < 0) ? -1 : 1;
4299 if ((
l >= m) && (
l >= n)) {
4302 for (i = 0; i <
l; i++) {
4303 if (cb(
result, input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4319 else if ((m >=
l) && (m >= n)) {
4322 for (i = 0; i < m; i++) {
4323 if (cb(
result, input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4342 for (i = 0; i < n; i++) {
4343 if (cb(
result, input, res, pixel, t_ray, correct) <= FLT_EPSILON) {
4359 cb(
result, input, res, pixel, t_ray, correct);
4366 int slabsize = fds->
res[0] * fds->
res[1];
4369 float correct = -7.0f * fds->
dx;
4371 if (!get_light(view_layer, light)) {
4377 light[0] = (light[0] - fds->
p0[0]) / fds->
cell_size[0] - 0.5f - (
float)fds->
res_min[0];
4378 light[1] = (light[1] - fds->
p0[1]) / fds->
cell_size[1] - 0.5f - (
float)fds->
res_min[1];
4379 light[2] = (light[2] - fds->
p0[2]) / fds->
cell_size[2] - 0.5f - (
float)fds->
res_min[2];
4384 bv[3] = (
float)fds->
res[1];
4387 for (
int z = 0;
z < fds->
res[2];
z++) {
4388 size_t index =
z * slabsize;
4390 for (
int y = 0;
y < fds->
res[1];
y++) {
4392 float voxel_center[3];
4398 shadow[
index] = -1.0f;
4400 voxel_center[0] = (
float)
x;
4401 voxel_center[1] = (
float)
y;
4402 voxel_center[2] = (
float)
z;
4413 cell[0] = (int)
floor(light[0]);
4414 cell[1] = (int)
floor(light[1]);
4415 cell[2] = (int)
floor(light[2]);
4418 CLAMP(cell[0], 0, fds->
res[0] - 1);
4419 CLAMP(cell[1], 0, fds->
res[1] - 1);
4420 CLAMP(cell[2], 0, fds->
res[2] - 1);
4422 bresenham_linie_3D(cell[0],
4436 shadow[
index] = t_ray;
4455 float density = 0.0f, fuel = 0.0f;
4458 manta_pos_to_cell(fds,
pos);
4475 if (
pos[0] < 0.0f ||
pos[1] < 0.0f ||
pos[2] < 0.0f) {
4478 if (
pos[0] > 1.0f ||
pos[1] > 1.0f ||
pos[2] > 1.0f) {
4493 vel_mag =
len_v3(velocity);
4503 return MAX2(density, fuel);
4529 const char *pset_name,
4530 const char *parts_name,
4531 const char *psys_name,
4532 const int psys_type)
4542 part->
type = psys_type;
4566 next_psys = psys->
next;
4567 if (psys->
part->
type == particle_type) {
4714 const char coba_field = settings->
coba_field;
4718 if (
ELEM(coba_field,
4733 if (
ELEM(coba_field,
4858 else if (fmd->
flow) {
4907 #ifndef WITH_OPENVDB
4912 #ifndef WITH_OPENVDB_BLOSC
4919 char cache_name[64];
5140 else if (tfmd->
flow) {
5197 static int counter = 1;
typedef float(TangentPoint)[2]
BVHTree * BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, struct Mesh *mesh, const BVHCacheType bvh_cache_type, const int tree_type)
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
struct Object ** BKE_collision_objects_create(struct Depsgraph *depsgraph, struct Object *self, struct Collection *collection, unsigned int *numcollobj, unsigned int modifier_type)
void BKE_collision_objects_free(struct Object **objects)
CustomData interface, see also DNA_customdata_types.h.
void * CustomData_set_layer(const struct CustomData *data, int type, void *ptr)
void * CustomData_get_layer_named(const struct CustomData *data, int type, const char *name)
void * CustomData_get_layer(const struct CustomData *data, int type)
void BKE_effectors_free(struct ListBase *lb)
void BKE_effectors_apply(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
struct EffectorWeights * BKE_effector_add_weights(struct Collection *collection)
void pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
void BKE_fluid_cache_free_all(struct FluidDomainSettings *fds, struct Object *ob)
int BKE_fluid_get_data_flags(struct FluidDomainSettings *fds)
bool BKE_fluid_reallocate_fluid(struct FluidDomainSettings *fds, int res[3], int free_old)
void BKE_fluid_particle_system_destroy(struct Object *ob, const int particle_type)
void BKE_fluid_particle_system_create(struct Main *bmain, struct Object *ob, const char *pset_name, const char *parts_name, const char *psys_name, const int psys_type)
struct Mesh * BKE_fluid_modifier_do(struct FluidModifierData *fmd, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct Mesh *me)
float(* BKE_Fluid_BresenhamFn)(float *result, const float *input, int res[3], int *pixel, float *tRay, float correct)
void BKE_fluid_reallocate_copy_fluid(struct FluidDomainSettings *fds, int o_res[3], int n_res[3], const int o_min[3], const int n_min[3], const int o_max[3], int o_shift[3], int n_shift[3])
float BKE_fluid_get_velocity_at(struct Object *ob, float position[3], float velocity[3])
void BKE_fluid_cache_free(struct FluidDomainSettings *fds, struct Object *ob, int cache_map)
void BKE_id_free(struct Main *bmain, void *idv)
void BKE_mesh_ensure_normals(struct Mesh *me)
struct Mesh * BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
void BKE_mesh_vert_normals_apply(struct Mesh *mesh, const short(*vert_normals)[3])
void BKE_mesh_texspace_calc(struct Mesh *me)
void BKE_mesh_calc_edges(struct Mesh *mesh, bool keep_existing_edges, const bool select_new_edges)
void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh)
void BKE_modifier_path_init(char *path, int path_maxlen, const char *name)
void BKE_modifier_free(struct ModifierData *md)
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
const char * BKE_modifier_path_relbase_from_global(struct Object *ob)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
void BKE_modifier_remove_from_list(struct Object *ob, struct ModifierData *md)
struct ModifierData * BKE_modifier_new(int type)
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md)
General operations, lookup, etc. for blender objects.
bool BKE_object_modifier_update_subframe(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, bool update_mesh, int parent_recursion, float frame, int type)
bool BKE_object_moves_in_time(const struct Object *object, bool recurse_parent)
struct LatticeDeformData * psys_create_lattice_deform_data(struct ParticleSimulationData *sim)
struct ParticleSettings * BKE_particlesettings_add(struct Main *bmain, const char *name)
int psys_get_particle_state(struct ParticleSimulationData *sim, int p, struct ParticleKey *state, int always)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
void psys_free(struct Object *ob, struct ParticleSystem *psys)
struct PointCache * BKE_ptcache_copy_list(struct ListBase *ptcaches_new, const struct ListBase *ptcaches_old, const int flag)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
void BKE_ptcache_free_list(struct ListBase *ptcaches)
float BKE_scene_frame_get(const struct Scene *scene)
void BKE_texture_get_value(const struct Scene *scene, struct Tex *texture, const float *tex_co, struct TexResult *texres, bool use_color_management)
#define BLI_assert_unreachable()
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *file, bool dir, bool recursive) ATTR_NONNULL()
BLI_INLINE unsigned int BLI_hash_int(unsigned int k)
float BLI_bvhtree_bb_raycast(const float bv[6], const float light_start[3], const float light_end[3], float pos[3])
int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
A kd-tree for nearest neighbor search.
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float pow2f(float x)
MINLINE int max_ii(int a, int b)
MINLINE int min_iii(int a, int b, int c)
void interp_weights_tri_v3(float w[3], const float v1[3], const float v2[3], const float v3[3], const float co[3])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void copy_vn_fl(float *array_tar, const int size, const float val)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_fl(float r[3], float f)
MINLINE void normal_float_to_short_v3(short r[3], const float n[3])
MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
void interp_v3_v3v3v3(float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void normal_short_to_float_v3(float r[3], const short n[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_v2_v2v2v2(float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
MINLINE void copy_v3_v3_int(int r[3], const int a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3_int(int r[3])
MINLINE void abs_v3(float r[3])
MINLINE void negate_v3(float r[3])
MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3])
MINLINE bool equals_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
size_t BLI_path_join(char *__restrict dst, const size_t dst_len, const char *path_first,...) ATTR_NONNULL(1
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
void BLI_task_parallel_range(const int start, const int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
#define THREAD_LOCK_WRITE
#define BLI_MUTEX_INITIALIZER
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
ThreadRWMutex * BLI_rw_mutex_alloc(void)
void BLI_rw_mutex_free(ThreadRWMutex *mutex)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
pthread_mutex_t ThreadMutex
#define INIT_MINMAX(min, max)
#define CLAMP3(vec, b, c)
float BLI_voxel_sample_trilinear(const float *data, const int res[3], const float co[3])
#define CLOG_ERROR(clg_ref,...)
struct Depsgraph Depsgraph
float DEG_get_ctime(const Depsgraph *graph)
struct ViewLayer * DEG_get_evaluated_view_layer(const struct Depsgraph *graph)
#define DNA_struct_default_alloc(struct_name)
@ FLUID_DOMAIN_BAKED_DATA
@ FLUID_DOMAIN_OUTDATED_GUIDE
@ FLUID_DOMAIN_OUTDATED_PARTICLES
@ FLUID_DOMAIN_BAKING_MESH
@ FLUID_DOMAIN_BAKING_NOISE
@ FLUID_DOMAIN_BAKING_GUIDE
@ FLUID_DOMAIN_OUTDATED_NOISE
@ FLUID_DOMAIN_BAKED_NOISE
@ FLUID_DOMAIN_BAKED_MESH
@ FLUID_DOMAIN_OUTDATED_MESH
@ FLUID_DOMAIN_BAKING_DATA
@ FLUID_DOMAIN_BAKED_GUIDE
@ FLUID_DOMAIN_BAKED_PARTICLES
@ FLUID_DOMAIN_OUTDATED_DATA
@ FLUID_DOMAIN_BAKING_PARTICLES
@ FLUID_FLOW_USE_PART_SIZE
@ FLUID_FLOW_NEEDS_UPDATE
@ FLUID_FLOW_USE_PLANE_INIT
@ FLUID_FLOW_INITVELOCITY
#define FLUID_DOMAIN_DIR_DATA
#define FLUID_DOMAIN_DIR_PARTICLES
@ FLUID_FLOW_SOURCE_PARTICLES
@ FLUID_EFFECTOR_TYPE_GUIDE
@ FLUID_EFFECTOR_TYPE_COLLISION
#define FLUID_DOMAIN_DIR_DEFAULT
#define FLUID_DOMAIN_DIR_MESH
#define FLUID_DOMAIN_DIR_GUIDE
#define FLUID_DOMAIN_DIR_SCRIPT
@ FLUID_EFFECTOR_NEEDS_UPDATE
@ FLUID_EFFECTOR_USE_EFFEC
@ FLUID_EFFECTOR_USE_PLANE_INIT
@ FLUID_FLOW_BEHAVIOR_GEOMETRY
@ FLUID_FLOW_BEHAVIOR_OUTFLOW
@ FLUID_FLOW_BEHAVIOR_INFLOW
@ FLUID_DOMAIN_PARTICLE_SPRAY
@ FLUID_DOMAIN_PARTICLE_FOAM
@ FLUID_DOMAIN_PARTICLE_TRACER
@ FLUID_DOMAIN_PARTICLE_BUBBLE
@ FLUID_DOMAIN_FIELD_COLOR_B
@ FLUID_DOMAIN_FIELD_FLAME
@ FLUID_DOMAIN_FIELD_PHI_OUT
@ FLUID_DOMAIN_FIELD_PHI_OBSTACLE
@ FLUID_DOMAIN_FIELD_DENSITY
@ FLUID_DOMAIN_FIELD_PHI_IN
@ FLUID_DOMAIN_FIELD_HEAT
@ FLUID_DOMAIN_FIELD_COLOR_G
@ FLUID_DOMAIN_FIELD_FUEL
@ FLUID_DOMAIN_FIELD_COLOR_R
@ FLUID_DOMAIN_CACHE_REPLAY
@ FLUID_DOMAIN_CACHE_MODULAR
@ FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN
@ FLUID_DOMAIN_USE_RESUMABLE_CACHE
@ FLUID_DOMAIN_EXPORT_MANTA_SCRIPT
@ FLUID_DOMAIN_USE_SPEED_VECTORS
@ FLUID_DOMAIN_ACTIVE_COLORS
@ FLUID_DOMAIN_ACTIVE_FIRE
@ FLUID_DOMAIN_ACTIVE_INVEL
@ FLUID_DOMAIN_ACTIVE_GUIDE
@ FLUID_DOMAIN_ACTIVE_OUTFLOW
@ FLUID_DOMAIN_ACTIVE_COLOR_SET
@ FLUID_DOMAIN_ACTIVE_HEAT
@ FLUID_DOMAIN_ACTIVE_OBSTACLE
#define FLUID_DOMAIN_DIR_CONFIG
@ VDB_PRECISION_MINI_FLOAT
@ VDB_PRECISION_HALF_FLOAT
@ FLUID_FLOW_TYPE_SMOKEFIRE
@ FLUID_DOMAIN_BORDER_BOTTOM
@ FLUID_DOMAIN_BORDER_LEFT
@ FLUID_DOMAIN_BORDER_RIGHT
@ FLUID_DOMAIN_BORDER_FRONT
@ FLUID_DOMAIN_BORDER_TOP
@ FLUID_DOMAIN_BORDER_BACK
@ FLUID_DOMAIN_GUIDE_SRC_DOMAIN
@ FLUID_FLOW_TEXTURE_MAP_AUTO
#define FLUID_DOMAIN_DIR_NOISE
@ FLUID_EFFECTOR_GUIDE_MAX
@ FLUID_EFFECTOR_GUIDE_OVERRIDE
@ FLUID_EFFECTOR_GUIDE_AVERAGED
@ FLUID_EFFECTOR_GUIDE_MIN
@ FLUID_DOMAIN_TYPE_LIQUID
@ eModifierFlag_SharedCaches
@ eModifierType_ParticleSystem
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
#define PART_DRAW_COL_VEL
@ PART_CHILD_USE_TWIST_CURVE
@ PART_CHILD_USE_CLUMP_CURVE
@ PART_CHILD_USE_ROUGH_CURVE
#define PTCACHE_DISK_CACHE
Types and defines for representing Rigid Body entities.
#define FIRSTBASE(_view_layer)
#define PHYS_GLOBAL_GRAVITY
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Depsgraph * depsgraph
void BKE_fluid_modifier_reset(struct FluidModifierData *fmd)
void BKE_fluid_cachetype_noise_set(FluidDomainSettings *settings, int cache_noise_format)
static void BKE_fluid_modifier_freeDomain(FluidModifierData *fmd)
void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd, struct FluidModifierData *tfmd, const int flag)
void BKE_fluid_cachetype_particle_set(FluidDomainSettings *settings, int cache_particle_format)
void BKE_fluid_flow_behavior_set(Object *UNUSED(object), FluidFlowSettings *settings, int behavior)
void BKE_fluid_domain_type_set(Object *object, FluidDomainSettings *settings, int type)
void BKE_fluid_particles_set(FluidDomainSettings *settings, int value, bool clear)
static void BKE_fluid_modifier_freeFlow(FluidModifierData *fmd)
void BKE_fluid_cachetype_data_set(FluidDomainSettings *settings, int cache_data_format)
static void BKE_fluid_modifier_freeEffector(FluidModifierData *fmd)
static void BKE_fluid_modifier_reset_ex(struct FluidModifierData *fmd, bool need_lock)
void BKE_fluid_modifier_create_type_data(struct FluidModifierData *fmd)
void BKE_fluid_collisionextents_set(FluidDomainSettings *settings, int value, bool clear)
void BKE_fluid_cache_new_name_for_current_session(int maxlen, char *r_name)
void BKE_fluid_cache_endframe_set(FluidDomainSettings *settings, int value)
void BKE_fluid_fields_sanitize(FluidDomainSettings *settings)
void BKE_fluid_cache_startframe_set(FluidDomainSettings *settings, int value)
void BKE_fluid_flow_type_set(Object *object, FluidFlowSettings *settings, int type)
void BKE_fluid_effector_type_set(Object *UNUSED(object), FluidEffectorSettings *settings, int type)
void BKE_fluid_cachetype_mesh_set(FluidDomainSettings *settings, int cache_mesh_format)
void BKE_fluid_modifier_free(FluidModifierData *fmd)
static float normals[][3]
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_calloc_arrayN)(size_t len, size_t size, const char *str)
void *(* MEM_callocN)(size_t len, const char *str)
float * manta_smoke_get_heat_in(struct MANTA *smoke)
bool manta_has_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_liquid_get_normal_x_at(struct MANTA *liquid, int i)
float * manta_smoke_get_shadow(struct MANTA *fluid)
float * manta_smoke_get_color_g(struct MANTA *smoke)
float * manta_get_force_y(struct MANTA *fluid)
bool manta_has_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phiobs_in(struct MANTA *fluid)
float manta_liquid_get_vertex_y_at(struct MANTA *liquid, int i)
float * manta_smoke_get_color_b(struct MANTA *smoke)
float * manta_smoke_get_emission_in(struct MANTA *smoke)
float * manta_noise_get_texture_w2(struct MANTA *smoke)
bool manta_ensure_invelocity(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_read_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool sourceDomain)
bool manta_has_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_bake_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phioutstatic_in(struct MANTA *fluid)
float * manta_smoke_get_fuel(struct MANTA *smoke)
float * manta_smoke_get_heat(struct MANTA *smoke)
bool manta_smoke_ensure_colors(struct MANTA *smoke, struct FluidModifierData *fmd)
void manta_free(struct MANTA *fluid)
bool manta_smoke_has_heat(struct MANTA *smoke)
int manta_liquid_get_num_triangles(struct MANTA *liquid)
bool manta_bake_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_get_timestep(struct MANTA *fluid)
float * manta_get_in_velocity_x(struct MANTA *fluid)
bool manta_bake_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_smoke_get_color_g_in(struct MANTA *smoke)
float * manta_smoke_get_color_b_in(struct MANTA *smoke)
float * manta_noise_get_texture_u2(struct MANTA *smoke)
float * manta_smoke_get_color_r_in(struct MANTA *smoke)
float * manta_get_phistatic_in(struct MANTA *fluid)
float * manta_get_guide_velocity_z(struct MANTA *fluid)
float * manta_smoke_get_density(struct MANTA *smoke)
float * manta_smoke_get_color_r(struct MANTA *smoke)
bool manta_read_mesh(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_liquid_ensure_sndparts(struct MANTA *fluid, struct FluidModifierData *fmd)
float * manta_get_force_x(struct MANTA *fluid)
float * manta_get_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_flame(struct MANTA *smoke)
float * manta_noise_get_texture_v2(struct MANTA *smoke)
bool manta_write_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
int * manta_smoke_get_flags(struct MANTA *smoke)
float * manta_get_phi_in(struct MANTA *fluid)
bool manta_smoke_ensure_fire(struct MANTA *smoke, struct FluidModifierData *fmd)
float * manta_get_velocity_y(struct MANTA *fluid)
void manta_noise_get_res(struct MANTA *smoke, int *res)
float * manta_noise_get_fuel(struct MANTA *smoke)
float manta_liquid_get_vertvel_y_at(struct MANTA *liquid, int i)
int manta_liquid_get_num_verts(struct MANTA *liquid)
bool manta_ensure_obstacle(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_write_config(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_in_velocity_z(struct MANTA *fluid)
float * manta_noise_get_texture_v(struct MANTA *smoke)
bool manta_needs_realloc(struct MANTA *fluid, struct FluidModifierData *fmd)
bool manta_has_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_liquid_get_vertvel_z_at(struct MANTA *liquid, int i)
bool manta_read_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
float * manta_get_num_guide(struct MANTA *fluid)
size_t manta_get_index(int x, int max_x, int y, int max_y, int z)
bool manta_read_particles(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
bool manta_write_noise(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_force_z(struct MANTA *fluid)
float manta_liquid_get_vertvel_x_at(struct MANTA *liquid, int i)
float * manta_get_ob_velocity_x(struct MANTA *fluid)
float * manta_smoke_get_fuel_in(struct MANTA *smoke)
bool manta_smoke_ensure_heat(struct MANTA *smoke, struct FluidModifierData *fmd)
void manta_update_pointers(struct MANTA *fluid, struct FluidModifierData *fmd, bool flush)
bool manta_ensure_guiding(struct MANTA *fluid, struct FluidModifierData *fmd)
float * manta_noise_get_density(struct MANTA *smoke)
bool manta_read_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool resumable)
float * manta_noise_get_color_b(struct MANTA *smoke)
float * manta_get_ob_velocity_z(struct MANTA *fluid)
float * manta_get_guide_velocity_x(struct MANTA *fluid)
float * manta_get_phiout_in(struct MANTA *fluid)
bool manta_has_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr, bool domain)
float * manta_noise_get_react(struct MANTA *smoke)
float * manta_noise_get_flame(struct MANTA *smoke)
bool manta_smoke_has_colors(struct MANTA *smoke)
bool manta_read_config(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float manta_liquid_get_vertex_z_at(struct MANTA *liquid, int i)
int manta_liquid_get_num_normals(struct MANTA *liquid)
float * manta_smoke_get_react_in(struct MANTA *smoke)
float * manta_get_in_velocity_y(struct MANTA *fluid)
float * manta_get_velocity_z(struct MANTA *fluid)
float * manta_noise_get_texture_w(struct MANTA *smoke)
int manta_liquid_get_triangle_z_at(struct MANTA *liquid, int i)
bool manta_smoke_has_fuel(struct MANTA *smoke)
float manta_liquid_get_vertex_x_at(struct MANTA *liquid, int i)
float * manta_smoke_get_react(struct MANTA *smoke)
bool manta_liquid_export_script(struct MANTA *smoke, struct FluidModifierData *fmd)
bool manta_ensure_outflow(struct MANTA *fluid, struct FluidModifierData *fmd)
float manta_liquid_get_normal_y_at(struct MANTA *liquid, int i)
void manta_update_variables(struct MANTA *fluid, struct FluidModifierData *fmd)
int manta_liquid_get_triangle_x_at(struct MANTA *liquid, int i)
float * manta_get_num_obstacle(struct MANTA *fluid)
float * manta_get_phiguide_in(struct MANTA *fluid)
struct MANTA * manta_init(int *res, struct FluidModifierData *fmd)
float * manta_get_guide_velocity_y(struct MANTA *fluid)
float * manta_get_ob_velocity_y(struct MANTA *fluid)
void manta_adapt_timestep(struct MANTA *fluid)
int manta_liquid_get_triangle_y_at(struct MANTA *liquid, int i)
float manta_liquid_get_normal_z_at(struct MANTA *liquid, int i)
float * manta_noise_get_texture_u(struct MANTA *smoke)
bool manta_bake_data(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
bool manta_smoke_export_script(struct MANTA *smoke, struct FluidModifierData *fmd)
float * manta_noise_get_color_r(struct MANTA *smoke)
bool manta_bake_guiding(struct MANTA *fluid, struct FluidModifierData *fmd, int framenr)
float * manta_get_phiobsstatic_in(struct MANTA *fluid)
float * manta_noise_get_color_g(struct MANTA *smoke)
float * manta_smoke_get_density_in(struct MANTA *smoke)
static void clear(Message *msg)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
static void update_velocities(PTCacheEdit *edit)
BVHTree_RayCastCallback raycast_callback
BVHTree_NearestPointCallback nearest_callback
float gridlines_upper_bound
float gridlines_lower_bound
float sndparticle_tau_min_wc
struct ListBase ptcaches[2]
int sndparticle_update_radius
struct FluidModifierData * fmd
char sndparticle_boundary
float fractions_threshold
char cache_particle_format
float particle_randomness
int sndparticle_potential_radius
int cache_frame_pause_mesh
struct Collection * force_group
float mesh_particle_radius
struct FluidDomainVertexVelocity * mesh_velocities
int cache_frame_pause_data
float flame_smoke_color[3]
float sndparticle_tau_max_wc
float sndparticle_tau_max_ta
struct Collection * effector_group
int cache_frame_pause_particles
int cache_frame_pause_guide
float sndparticle_tau_min_ta
char gridlines_cell_filter
struct PointCache * point_cache[2]
char sndparticle_combined_export
float particle_band_width
float sndparticle_tau_min_k
char cache_directory[1024]
float gridlines_range_color[4]
char vector_scale_with_magnitude
char vector_draw_mac_components
int cache_frame_pause_noise
struct Object * guide_parent
float sndparticle_tau_max_k
struct Collection * fluid_group
struct EffectorWeights * effector_weights
char gridlines_color_field
struct FluidModifierData * fmd
struct FluidModifierData * fmd
struct ParticleSystem * psys
struct Tex * noise_texture
struct FluidDomainSettings * domain
struct FluidEffectorSettings * effector
struct FluidFlowSettings * flow
struct CustomData pdata ldata
struct ModifierData * next
struct RigidBodyOb * rigidbody_object
struct CurveMapping * clumpcurve
struct CurveMapping * roughcurve
struct CurveMapping * twistcurve
struct Depsgraph * depsgraph
struct ParticleSystem * psys
struct ParticleSystem * psys
struct ParticleSystem * next
struct PointCache * pointcache
struct LatticeDeformData * lattice_deform_data
struct PhysicsSettings physics_settings
__forceinline const avxi abs(const avxi &a)
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)