104 static int neighX[8] = {1, 1, 0, -1, -1, -1, 0, 1};
105 static int neighY[8] = {0, 1, 1, 1, 0, -1, -1, -1};
112 #define SUBFRAME_RECURSION 5
114 #define BRUSH_USES_VELOCITY (1 << 0)
117 #define HIT_PROXIMITY 2
120 #define ON_MESH_EDGE -2
121 #define OUT_OF_TEXTURE -3
123 #define EFF_MOVEMENT_PER_FRAME 0.05f
125 #define WAVE_TIME_FAC (1.0f / 24.0f)
126 #define CANVAS_REL_SIZE 5.0f
128 #define MIN_WETNESS 0.001f
129 #define MAX_WETNESS 5.0f
138 (*r_value) - 1.0f /
time * scale;
243 #define ADJ_ON_MESH_EDGE (1 << 0)
244 #define ADJ_BORDER_PIXEL (1 << 1)
267 if (runtime_data ==
NULL) {
324 return (canvas_mesh) ? canvas_mesh->
totvert : 0;
398 sizeof(
surface->output_name2));
427 surface->output_name[0] =
'\0';
428 surface->output_name2[0] =
'\0';
433 strcpy(
surface->output_name,
"dp_");
440 strcat(
surface->output_name,
"paintmap");
441 strcat(
surface->output_name2,
"wetmap");
445 strcat(
surface->output_name,
"displace");
448 strcat(
surface->output_name,
"weight");
451 strcat(
surface->output_name,
"wave");
460 return (
surface->data->total_points * 5);
464 return (
surface->data->total_points +
surface->data->adj_data->total_targets);
467 return surface->data->total_points;
472 const float s_color[3],
477 float i_alpha = 1.0f - s_alpha;
478 float f_alpha = t_alpha * i_alpha + s_alpha;
482 for (
int i = 0; i < 3; i++) {
483 result[i] = (t_color[i] * t_alpha * i_alpha + s_color[i] * s_alpha) / f_alpha;
495 float a_color[3],
float a_weight,
const float b_color[3],
float b_weight,
float ratio)
497 float weight_ratio, factor;
502 return b_weight * ratio;
504 weight_ratio = b_weight / (a_weight + b_weight);
507 return a_weight * (1.0f - ratio);
512 factor = weight_ratio * (ratio * 2.0f);
515 ratio = (ratio * 2.0f - 1.0f);
516 factor = weight_ratio * (1.0f - ratio) + ratio;
520 return (1.0f - factor) * a_weight + factor * b_weight;
532 unsigned int numobjects;
538 for (
int i = 0; i < numobjects; i++) {
539 Object *brushObj = objects[i];
566 for (
int i = 2; i--;) {
567 if (!(b1->
min[i] <= b2->
max[i] && b1->
max[i] >= b2->
min[i])) {
580 for (
int i = 2; i--;) {
581 if (!(b1->
min[i] <= (b2->
max[i] + dist) && b1->
max[i] >= (b2->
min[i] - dist))) {
594 for (
int i = 2; i--;) {
595 if (!(b->
min[i] <= (point[i] + radius) && b->
max[i] >= (point[i] - radius))) {
649 Bounds3D *grid_bound = tls->userdata_chunk;
655 void *__restrict chunk_join,
656 void *__restrict chunk)
672 int *s_num = tls->userdata_chunk;
676 for (
int j = 3; j--;) {
678 bData->
dim[j] * grid->
dim[j]);
682 temp_t_index[i] = co[0] + co[1] * grid->
dim[0] + co[2] * grid->
dim[0] * grid->
dim[1];
683 s_num[temp_t_index[i]]++;
687 void *__restrict chunk_join,
688 void *__restrict chunk)
692 const int grid_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
694 int *join_s_num = chunk_join;
698 for (
int i = 0; i < grid_cells; i++) {
699 join_s_num[i] += s_num[i];
709 float *dim = bData->
dim;
710 int *grid_dim = grid->
dim;
712 for (
int y = 0;
y < grid_dim[1];
y++) {
713 for (
int z = 0;
z < grid_dim[2];
z++) {
714 const int b_index =
x +
y * grid_dim[0] +
z * grid_dim[0] * grid_dim[1];
716 for (
int j = 3; j--;) {
717 const int s = (j == 0) ?
x : ((j == 1) ?
y :
z);
731 int grid_cells, axis = 3;
732 int *temp_t_index =
NULL;
733 int *temp_s_num =
NULL;
744 float dim_factor, volume, dim[3];
764 min_dim =
max_fff(td[0], td[1], td[2]) / 1000.0f;
767 for (i = 0; i < 3; i++) {
768 if (td[i] < min_dim) {
774 if (axis == 0 ||
max_fff(td[0], td[1], td[2]) < 0.0001f) {
781 volume = td[0] * td[1] * td[2];
788 for (i = 0; i < 3; i++) {
789 grid->
dim[i] = (int)
floor(td[i] / dim_factor);
790 CLAMP(grid->
dim[i], (dim[i] >= min_dim) ? 3 : 1, 100);
792 grid_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
796 grid->
s_pos =
MEM_callocN(
sizeof(
int) * grid_cells,
"Surface Grid Position");
799 temp_s_num =
MEM_callocN(
sizeof(
int) * grid_cells,
"Temp Surface Grid Points");
802 "Temp Surface Grid Target Ids");
823 for (i = 1; i < grid_cells; i++) {
829 int pos = grid->
s_pos[temp_t_index[i]] + temp_s_num[temp_t_index[i]];
832 temp_s_num[temp_t_index[i]]++;
879 if (
data->adj_data) {
880 if (
data->adj_data->n_index) {
883 if (
data->adj_data->n_num) {
886 if (
data->adj_data->n_target) {
889 if (
data->adj_data->flags) {
892 if (
data->adj_data->border) {
958 if (
data->format_data) {
972 if (
data->type_data) {
991 if (
surface->effector_weights) {
1053 surface->pointcache->step = 1;
1064 surface->color_dry_threshold = 1.0f;
1070 surface->influence_scale = 1.0f;
1073 surface->init_color[0] = 1.0f;
1074 surface->init_color[1] = 1.0f;
1075 surface->init_color[2] = 1.0f;
1076 surface->init_color[3] = 1.0f;
1078 surface->image_resolution = 256;
1091 surface->color_spread_speed = 1.0f;
1094 surface->wave_damping = 0.04f;
1096 surface->wave_timescale = 1.0f;
1098 surface->wave_smoothness = 1.0f;
1101 surface->image_output_path,
sizeof(
surface->image_output_path),
"cache_dynamicpaint");
1128 "DynamicPaint Canvas");
1159 brush->
alpha = 1.0f;
1184 ramp[0].
r = ramp[0].
g = ramp[0].
b = ramp[0].
a = 1.0f;
1186 ramp[1].
r = ramp[1].
g = ramp[1].
b = ramp[1].
pos = 1.0f;
1200 ramp[0].
r = ramp[0].
g = ramp[0].
b = ramp[0].
a = ramp[0].
pos = 0.0f;
1201 ramp[1].
r = ramp[1].
g = ramp[1].
b = ramp[1].
a = ramp[1].
pos = 1.0f;
1305 t_brush->
pmd = tpmd;
1307 t_brush->flags = brush->
flags;
1310 t_brush->r = brush->
r;
1311 t_brush->g = brush->
g;
1312 t_brush->b = brush->
b;
1313 t_brush->alpha = brush->
alpha;
1314 t_brush->wetness = brush->
wetness;
1323 t_brush->psys = brush->
psys;
1334 t_brush->ray_dir = brush->
ray_dir;
1351 "DynamicPaintSurface Data");
1355 "DynamicPaintSurface DepthData");
1359 "DynamicPaintSurface WeightData");
1363 "DynamicPaintSurface WaveData");
1391 int neigh_points = 0;
1405 if (!neigh_points) {
1442 for (
int i = 0; i < numOfEdges; i++) {
1446 temp_data[edge[i].
v1]++;
1447 temp_data[edge[i].v2]++;
1452 for (
int i = 0; i < numOfPolys; i++) {
1453 for (
int j = 0; j < mpoly[i].
totloop; j++) {
1454 temp_data[mloop[mpoly[i].
loopstart + j].
v]++;
1461 if ((temp_data[i] % 2) || (temp_data[i] < 4)) {
1473 n_pos += ad->
n_num[i];
1477 for (
int i = 0; i < numOfEdges; i++) {
1479 int index = edge[i].
v1;
1480 n_pos = ad->
n_index[index] + temp_data[index];
1486 n_pos = ad->
n_index[index] + temp_data[index];
1525 const bool scene_color_manage =
data->scene_color_manage;
1527 float uv[3] = {0.0f};
1529 for (
int j = 3; j--;) {
1531 const unsigned int vert = mloop[mlooptri[i].tri[j]].v;
1534 uv[0] = mloopuv[mlooptri[i].tri[j]].uv[0] * 2.0f - 1.0f;
1535 uv[1] = mloopuv[mlooptri[i].tri[j]].uv[1] * 2.0f - 1.0f;
1539 if (texres.
tin > pPoint[vert].color[3]) {
1541 pPoint[vert].color[3] = texres.
tin;
1560 const bool scene_color_manage =
data->scene_color_manage;
1562 float uv[9] = {0.0f};
1563 float uv_final[3] = {0.0f};
1568 for (
int j = 3; j--;) {
1569 copy_v2_v2(&uv[j * 3], mloopuv[mlooptri[f_data->uv_p[i].tri_index].tri[j]].uv);
1573 interp_v3_v3v3v3(uv_final, &uv[0], &uv[3], &uv[6], f_data->barycentricWeights[i * samples].v);
1575 uv_final[0] = uv_final[0] * 2.0f - 1.0f;
1576 uv_final[1] = uv_final[1] * 2.0f - 1.0f;
1598 const int tri_idx = f_data->uv_p[i].tri_index;
1600 float final_color[4];
1603 for (
int j = 3; j--;) {
1665 .mlooptri = mlooptri,
1668 .scene_color_manage = scene_color_manage,
1680 .mlooptri = mlooptri,
1682 .scene_color_manage = scene_color_manage,
1704 for (
int i = 0; i < totloop; i++) {
1718 .mlooptri = mlooptri,
1735 unsigned int data_size;
1744 data_size =
sizeof(
float);
1773 if (numOfPoints < 1) {
1784 surface->data->total_points = numOfPoints;
1831 const float *value = (
float *)
surface->data->type_data;
1832 const float val = value[i] *
surface->disp_factor;
1871 float(*fcolor)[4] =
data->fcolor;
1875 pPoint[i].color, pPoint[i].color[3], pPoint[i].e_color, pPoint[i].e_color[3], fcolor[i]);
1889 float(*fcolor)[4] =
data->fcolor;
1894 for (
int j = 0; j < mpoly[p_index].
totloop; j++) {
1895 const int l_index = mpoly[p_index].
loopstart + j;
1896 const int v_index = mloop[l_index].
v;
1906 mloopcol_wet[l_index].
r =
c;
1907 mloopcol_wet[l_index].
g =
c;
1908 mloopcol_wet[l_index].
b =
c;
1909 mloopcol_wet[l_index].
a = 255;
1939 bool update_normals =
false;
1956 const int totloop =
result->totloop;
1958 const int totpoly =
result->totpoly;
1962 "Temp paint color");
2000 data.mloopcol = mloopcol;
2001 data.mloopcol_wet = mloopcol_wet;
2020 float *weight = (
float *)sData->
type_data;
2023 if (defgrp_index != -1 && !dvert && (
surface->output_name[0] !=
'\0')) {
2029 if (defgrp_index != -1 && dvert) {
2035 if ((def_weight !=
NULL) || (weight[i] != 0.0f)) {
2037 if (def_weight ==
NULL) {
2042 def_weight->
weight = weight[i];
2060 update_normals =
true;
2066 update_normals =
true;
2072 if (update_normals) {
2131 bool no_surface_data;
2151 if (no_surface_data || current_frame !=
surface->current_frame ||
2155 surface->current_frame = current_frame;
2171 bool can_simulate = ((int)
scene->
r.
cfra == current_frame) &&
2178 else if (can_simulate) {
2217 #define JITTER_SAMPLES \
2219 0.0f, 0.0f, -0.2f, -0.4f, 0.2f, 0.4f, 0.4f, -0.2f, -0.4f, 0.3f, \
2249 const int tottri =
data->tottri;
2255 const int w =
surface->image_resolution;
2258 for (
int tx = 0; tx <
w; tx++) {
2259 const int index = tx +
w * ty;
2269 point[0][0] = ((
float)tx + 0.5f) /
w;
2270 point[0][1] = ((
float)ty + 0.5f) / h;
2276 point[1][0] = ((
float)tx) /
w;
2277 point[1][1] = ((
float)ty) / h;
2279 point[2][0] = ((
float)tx + 1) /
w;
2280 point[2][1] = ((
float)ty) / h;
2282 point[3][0] = ((
float)tx) /
w;
2283 point[3][1] = ((
float)ty + 1) / h;
2285 point[4][0] = ((
float)tx + 1) /
w;
2286 point[4][1] = ((
float)ty + 1) / h;
2292 for (
int i = 0; i < tottri; i++) {
2294 if ((faceBB[i].
min[0] > point[
sample][0]) || (faceBB[i].
min[1] > point[
sample][1]) ||
2299 const float *uv1 = mloopuv[mlooptri[i].
tri[0]].
uv;
2300 const float *uv2 = mloopuv[mlooptri[i].
tri[1]].
uv;
2301 const float *uv3 = mloopuv[mlooptri[i].
tri[2]].
uv;
2309 uv[0] = point[0][0] + jitter5sample[j * 2] /
w;
2310 uv[1] = point[0][1] + jitter5sample[j * 2 + 1] / h;
2319 tPoint->
v1 = mloop[mlooptri[i].
tri[0]].
v;
2320 tPoint->
v2 = mloop[mlooptri[i].
tri[1]].
v;
2321 tPoint->
v3 = mloop[mlooptri[i].
tri[2]].
v;
2348 const int w =
surface->image_resolution;
2351 for (
int tx = 0; tx <
w; tx++) {
2352 const int index = tx +
w * ty;
2360 const int u_min = (tx > 0) ? -1 : 0;
2361 const int u_max = (tx < (
w - 1)) ? 1 : 0;
2362 const int v_min = (ty > 0) ? -1 : 0;
2363 const int v_max = (ty < (h - 1)) ? 1 : 0;
2365 point[0] = ((
float)tx + 0.5f) /
w;
2366 point[1] = ((
float)ty + 0.5f) / h;
2369 for (
int ni = 0; ni < 8; ni++) {
2373 if (u >= u_min && u <= u_max && v >= v_min &&
v <= v_max) {
2375 if (u != 0 ||
v != 0) {
2376 const int ind = (tx + u) +
w * (ty +
v);
2379 if (tempPoints[ind].neighbor_pixel == -1 && tempPoints[ind].tri_index != -1) {
2381 const int i = tempPoints[ind].
tri_index;
2382 const float *uv1 = mloopuv[mlooptri[i].
tri[0]].
uv;
2383 const float *uv2 = mloopuv[mlooptri[i].
tri[1]].
uv;
2384 const float *uv3 = mloopuv[mlooptri[i].
tri[2]].
uv;
2401 uv[0] = point[0] + jitter5sample[j * 2] /
w;
2402 uv[1] = point[1] + jitter5sample[j * 2 + 1] / h;
2407 tPoint->
v1 = mloop[mlooptri[i].
tri[0]].
v;
2408 tPoint->
v2 = mloop[mlooptri[i].
tri[1]].
v;
2409 tPoint->
v3 = mloop[mlooptri[i].
tri[2]].
v;
2425 #undef JITTER_SAMPLES
2430 const float point[2])
2434 float min_distance = FLT_MAX;
2436 for (
int i = 0; i < 3; i++) {
2439 mloopuv[mlooptri[tri_index].tri[(i + 0)]].uv,
2440 mloopuv[mlooptri[tri_index].tri[(i + 1) % 3]].uv);
2442 if (dist_squared < min_distance) {
2443 min_distance = dist_squared;
2447 return min_distance;
2461 const float pixel[2],
2485 const int x = px +
neighX[n_index];
2486 const int y = py +
neighY[n_index];
2488 if (x < 0 || x >=
w || y < 0 || y >= h) {
2529 .best_weight = 1.0f,
2534 pixel[0] = ((
float)(px +
neighX[n_index]) + 0.5f) / (
float)
w;
2535 pixel[1] = ((
float)(py +
neighY[n_index]) + 0.5f) / (
float)h;
2547 const float pixel[2],
2555 const unsigned int *loop_idx = mlooptri[tri_index].
tri;
2558 for (
int edge_idx = 0; edge_idx < 3; edge_idx++) {
2560 if (edge_idx == in_edge) {
2564 float uv0[2], uv1[2], uv2[2];
2566 copy_v2_v2(uv0, mloopuv[loop_idx[(edge_idx + 0)]].uv);
2567 copy_v2_v2(uv1, mloopuv[loop_idx[(edge_idx + 1) % 3]].uv);
2568 copy_v2_v2(uv2, mloopuv[loop_idx[(edge_idx + 2) % 3]].uv);
2575 if (side2 == 0.0f) {
2580 const bool correct_side = (in_edge == -1) || (sidep < 0 && side2 > 0) ||
2581 (sidep > 0 && side2 < 0);
2584 if (!correct_side && sidep != 0.0f) {
2589 const int vert0 = mloop[loop_idx[(edge_idx + 0)]].
v;
2590 const int vert1 = mloop[loop_idx[(edge_idx + 1) % 3]].
v;
2596 bool found_other =
false;
2597 int target_tri = -1;
2598 int target_edge = -1;
2600 float ouv0[2], ouv1[2];
2602 for (
int i = 0; i < map->count && !found_other; i++) {
2603 const int lt_index = map->
indices[i];
2605 if (lt_index == tri_index) {
2609 const unsigned int *other_loop_idx = mlooptri[lt_index].
tri;
2612 for (
int j = 0; j < 3; j++) {
2613 const int overt0 = mloop[other_loop_idx[(j + 0)]].
v;
2614 const int overt1 = mloop[other_loop_idx[(j + 1) % 3]].
v;
2617 if (overt0 == vert0 && overt1 == vert1) {
2619 copy_v2_v2(ouv0, mloopuv[other_loop_idx[(j + 0)]].uv);
2620 copy_v2_v2(ouv1, mloopuv[other_loop_idx[(j + 1) % 3]].uv);
2622 else if (overt0 == vert1 && overt1 == vert0) {
2624 copy_v2_v2(ouv1, mloopuv[other_loop_idx[(j + 0)]].uv);
2625 copy_v2_v2(ouv0, mloopuv[other_loop_idx[(j + 1) % 3]].uv);
2629 target_tri = lt_index;
2646 if (depth > 0 && correct_side) {
2665 float closest_point[2], dir_vec[2], tgt_pixel[2];
2668 CLAMP(lambda, 0.0f, 1.0f);
2673 int w = bdata->
w, h = bdata->
h, px = bdata->
px, py = bdata->
py;
2675 const int final_pixel[2] = {(int)
floorf(tgt_pixel[0] *
w), (int)
floorf(tgt_pixel[1] * h)};
2678 if (final_pixel[0] < 0 || final_pixel[0] >=
w || final_pixel[1] < 0 || final_pixel[1] >= h) {
2687 int final_index = final_pixel[0] +
w * final_pixel[1];
2690 if (final_index == (px +
w * py)) {
2695 if (tempPoints[final_index].neighbor_pixel != -1) {
2699 if (final_index == (px +
w * py)) {
2704 const int final_tri_index = tempPoints[final_index].
tri_index;
2706 if (!
ELEM(final_tri_index, target_tri, -1)) {
2709 const float final_pt[2] = {((final_index %
w) + 0.5f) /
w, ((final_index /
w) + 0.5f) / h};
2710 const float threshold =
square_f(0.7f) / (
w * h);
2725 const int idx = ed->
n_index[index];
2727 for (
int i = 0; i < ed->
n_num[index]; i++) {
2728 if (ed->
n_target[idx + i] == neighbor) {
2740 int *new_n_index =
MEM_callocN(
sizeof(
int) * active_points,
"Surface Adj Index");
2741 int *new_n_num =
MEM_callocN(
sizeof(
int) * active_points,
"Surface Adj Counts");
2743 if (new_n_num && new_n_index) {
2745 int total_targets = 0;
2747 for (
int index = 0; index < active_points; index++) {
2748 total_targets += ed->
n_num[index];
2749 new_n_num[index] = ed->
n_num[index];
2752 for (
int index = 0; index < active_points; index++) {
2757 for (
int i = 0, idx = ed->
n_index[index]; i < ed->n_num[index]; i++) {
2758 const int target = ed->
n_target[idx + i];
2763 new_n_num[target]++;
2770 int *new_n_target =
MEM_callocN(
sizeof(
int) * total_targets,
"Surface Adj Targets");
2776 for (
int index = 0; index < active_points; index++) {
2777 new_n_index[index] = n_pos;
2778 memcpy(&new_n_target[n_pos],
2780 sizeof(
int) * ed->
n_num[index]);
2783 n_pos += new_n_num[index];
2784 new_n_num[index] = ed->
n_num[index];
2790 for (
int index = 0; index < active_points; index++) {
2795 for (
int i = 0, idx = ed->
n_index[index]; i < ed->n_num[index]; i++) {
2796 const int target = ed->
n_target[idx + i];
2799 const int num = new_n_num[target]++;
2800 new_n_target[new_n_index[target] + num] = index;
2813 ed->
n_num = new_n_num;
2858 return setError(canvas,
N_(
"Canvas mesh not updated"));
2861 return setError(canvas,
N_(
"Cannot bake non-'image sequence' formats"));
2876 return setError(canvas,
N_(
"No UV data on canvas"));
2878 if (
surface->image_resolution < 16 ||
surface->image_resolution > 8192) {
2879 return setError(canvas,
N_(
"Invalid resolution"));
2882 const int w =
surface->image_resolution;
2888 CLOG_INFO(&
LOG, 1,
"Preparing UV surface of %ix%i pixels and %i tris.",
w, h, tottri);
2896 return setError(canvas,
N_(
"Not enough free memory"));
2899 tempPoints =
MEM_callocN(
w * h *
sizeof(*tempPoints),
"Temp PaintUVPoint");
2904 final_index =
MEM_callocN(
w * h *
sizeof(*final_index),
"Temp UV Final Indexes");
2919 faceBB =
MEM_mallocN(tottri *
sizeof(*faceBB),
"MPCanvasFaceBB");
2929 for (
int i = 0; i < tottri; i++) {
2933 for (
int j = 1; j < 3; j++) {
2944 .tempPoints = tempPoints,
2945 .tempWeights = tempWeights,
2946 .mlooptri = mlooptri,
2968 data.active_points = &active_points;
2985 for (
int i = 0; i <
w * h; i++) {
2986 if (tempPoints[i].tri_index != -1) {
2987 final_index[i] = cursor;
3000 int *vert_to_looptri_map_mem;
3003 &vert_to_looptri_map_mem,
3011 int total_border = 0;
3013 for (
int ty = 0; ty < h; ty++) {
3014 for (
int tx = 0; tx <
w; tx++) {
3015 const int index = tx +
w * ty;
3017 if (tempPoints[index].tri_index != -1) {
3018 ed->
n_index[final_index[index]] = n_pos;
3019 ed->
n_num[final_index[index]] = 0;
3021 if (tempPoints[index].neighbor_pixel != -1) {
3026 for (
int i = 0; i < 8; i++) {
3030 &
data, vert_to_looptri_map,
w, h, tx, ty, i);
3032 if (n_target >= 0 && n_target != index) {
3034 ed, final_index[index], final_index[n_target])) {
3035 ed->
n_target[n_pos] = final_index[n_target];
3036 ed->
n_num[final_index[index]]++;
3062 for (
int i = 0,
next = 0; i < active_points; i++) {
3073 FILE *dump_file = fopen(
"dynpaint-adj-data.txt",
"w");
3074 int *tmp =
MEM_callocN(
sizeof(
int) * active_points,
"tmp");
3075 for (
int ty = 0; ty < h; ty++) {
3076 for (
int tx = 0; tx <
w; tx++) {
3077 const int index = tx +
w * ty;
3078 if (tempPoints[index].tri_index != -1) {
3079 tmp[final_index[index]] = index;
3083 for (
int ty = 0; ty < h; ty++) {
3084 for (
int tx = 0; tx <
w; tx++) {
3085 const int index = tx +
w * ty;
3086 const int fidx = final_index[index];
3088 if (tempPoints[index].tri_index != -1) {
3091 "%d\t%d,%d\t%u\t%d,%d\t%d\t",
3095 tempPoints[index].tri_index,
3096 nidx < 0 ? -1 : (nidx %
w),
3097 nidx < 0 ? -1 : h - 1 - (nidx /
w),
3099 for (
int i = 0; i < ed->
n_num[fidx]; i++) {
3101 fprintf(dump_file,
"%s%d,%d", i ?
" " :
"", tgt %
w, h - 1 - tgt /
w);
3103 fprintf(dump_file,
"\n");
3148 for (
int index = 0, cursor = 0; index < (
w * h); index++) {
3149 if (tempPoints[index].tri_index != -1) {
3160 setError(canvas,
N_(
"Not enough free memory"));
3184 for (index = 0; index < sData->
total_points; index++) {
3188 pPoint->alpha = 1.0f;
3191 if (uvPoint->neighbor_pixel != -1) {
3192 pPoint->
color[2] = 1.0f;
3196 if (uvPoint->tri_index != -1) {
3197 pPoint->
color[0] = 1.0f;
3198 pPoint->
color[1] = (
float)(uvPoint->tri_index % 255) / 256.0f;
3209 return (
error == 0);
3248 float depth = ((
float *)
surface->data->type_data)[index];
3255 depth /=
surface->depth_clamp;
3259 depth = (0.5f - depth / 2.0f);
3262 CLAMP(depth, 0.0f, 1.0f);
3275 float depth = wPoint->
height;
3282 depth /=
surface->depth_clamp;
3285 depth = (0.5f + depth / 2.0f);
3286 CLAMP(depth, 0.0f, 1.0f);
3324 #ifndef WITH_OPENEXR
3329 BLI_strncpy(output_file, filename,
sizeof(output_file));
3349 switch (output_layer) {
3378 switch (output_layer) {
3398 switch (output_layer) {
3460 const float *t0, *t1, *t2;
3463 t0 = vert[mloop[mlooptri[index].
tri[0]].
v].
co;
3464 t1 = vert[mloop[mlooptri[index].
tri[1]].
v].
co;
3465 t2 = vert[mloop[mlooptri[index].
tri[2]].
v].
co;
3469 if (dist >= 0 && dist < hit->dist) {
3491 float nearest_tmp[3], dist_sq;
3493 const float *t0, *t1, *t2;
3494 t0 = vert[mloop[mlooptri[index].
tri[0]].
v].
co;
3495 t1 = vert[mloop[mlooptri[index].
tri[1]].
v].
co;
3496 t2 = vert[mloop[mlooptri[index].
tri[2]].
v].
co;
3501 if (dist_sq < nearest->dist_sq) {
3502 nearest->
index = index;
3505 nearest->
no[0] = 0.0f;
3523 const int paintFlags,
3524 const float paintColor[3],
3525 const float paintAlpha,
3526 const float paintWetness,
3527 const float timescale)
3547 float wetness = paintWetness;
3548 CLAMP(wetness, 0.0f, 1.0f);
3559 float a_ratio, a_highest;
3561 float invFact = 1.0f - paintAlpha;
3569 if (a_highest > invFact) {
3570 a_ratio = invFact / a_highest;
3572 pPoint->
e_color[3] *= a_ratio;
3573 pPoint->
color[3] *= a_ratio;
3577 pPoint->
e_color[3] -= paintAlpha * timescale;
3579 pPoint->
color[3] -= paintAlpha * timescale;
3583 wetness = (1.0f - paintWetness) * pPoint->
e_color[3];
3593 const float isect_change = isect_height - wPoint->
brush_isect;
3601 isect_height *= wave_factor;
3604 if (wave_factor > 0.0f && wPoint->
height > isect_height) {
3607 else if (wave_factor < 0.0f && wPoint->
height < isect_height) {
3614 wPoint->
height = isect_height;
3625 if (isect_change < 0.0f) {
3626 wPoint->
height += isect_change * wave_factor;
3646 const float timescale)
3652 influence *=
surface->influence_scale;
3653 depth *=
surface->influence_scale;
3655 strength = influence * brush->
alpha;
3656 CLAMP(strength, 0.0f, 1.0f);
3663 CLAMP(vel_factor, 0.0f, 1.0f);
3670 strength *= coba_res[3];
3673 depth *= coba_res[3];
3680 float paintWetness = brush->
wetness * strength;
3681 float paintAlpha = strength;
3684 surface, index, brush->
flags, paint, paintAlpha, paintWetness, timescale);
3688 float *value = (
float *)sData->
type_data;
3691 depth = value[index] + depth;
3699 value[index] *= (1.0f - strength);
3708 float *value = (
float *)sData->
type_data;
3711 value[index] *= (1.0f - strength);
3773 float(*prev_obmat)[4] =
data->prev_obmat;
3775 const float timescale =
data->timescale;
3796 float prev_obmat[4][4];
3797 Mesh *mesh_p, *mesh_c;
3798 MVert *mvert_p, *mvert_c;
3799 int numOfVerts_p, numOfVerts_c;
3803 float prev_sfra = cur_sfra - timescale;
3804 int prev_fra = cur_fra;
3806 if (prev_sfra < 0.0f) {
3808 prev_fra = cur_fra - 1;
3823 numOfVerts_p = mesh_p->
totvert;
3824 mvert_p = mesh_p->
mvert;
3839 numOfVerts_c = mesh_c->
totvert;
3840 mvert_c = mesh_c->
mvert;
3843 "Dynamic Paint brush velocity");
3849 if (numOfVerts_p != numOfVerts_c) {
3855 .brush_vel = *brushVel,
3859 .prev_obmat = prev_obmat,
3860 .timescale = timescale,
3875 float prev_obmat[4][4];
3876 float cur_loc[3] = {0.0f}, prev_loc[3] = {0.0f};
3880 float prev_sfra = cur_sfra - timescale;
3881 int prev_fra = cur_fra;
3883 if (prev_sfra < 0.0f) {
3885 prev_fra = cur_fra - 1;
3958 const float timescale =
data->timescale;
3959 const int c_index =
data->c_index;
3964 const float brush_radius =
data->brush_radius;
3965 const float *avg_brushNor =
data->avg_brushNor;
3966 const Vec3f *brushVelocity =
data->brushVelocity;
3971 const int samples = bData->
s_num[index];
3973 float total_sample = (
float)samples;
3974 float brushStrength = 0.0f;
3976 float velocity_val = 0.0f;
3978 float paintColor[3] = {0.0f};
3987 for (ss = 0; ss < samples; ss++) {
3988 float ray_start[3], ray_dir[3];
3989 float sample_factor = 0.0f;
3990 float sampleStrength = 0.0f;
3993 short hit_found = 0;
3996 float volume_factor = 0.0f;
3998 float proximity_factor = 0.0f;
3999 float prox_colorband[4] = {0.0f};
4012 sample_factor = 1.0f;
4025 nearest.
dist_sq = brush_radius * brush_radius;
4031 if (hit.
index != -1) {
4035 const int vtri[3] = {
4048 const float dist = hit.
dist;
4049 const int f_index = hit.
index;
4060 if (hit.
index != -1) {
4062 volume_factor = 1.0f;
4070 depth += dist * sample_factor;
4080 float proxDist = -1.0f;
4081 float hitCo[3] = {0.0f, 0.0f, 0.0f};
4085 if (inner_proximity && !hit_found) {
4093 if (nearest.
index != -1) {
4096 tri = nearest.
index;
4100 float proj_ray[3] = {0.0f};
4113 hit.
dist = brush_radius;
4118 if (hit.
index != -1) {
4119 proxDist = hit.
dist;
4129 if (proxDist >= 0.0f && proxDist <= brush_radius) {
4130 proximity_factor = proxDist / brush_radius;
4131 CLAMP(proximity_factor, 0.0f, 1.0f);
4132 if (!inner_proximity) {
4133 proximity_factor = 1.0f - proximity_factor;
4150 volume_factor = 1.0f - volume_factor;
4151 if (inner_proximity) {
4152 proximity_factor = 1.0f - proximity_factor;
4158 sampleStrength = volume_factor;
4164 proximity_factor = prox_colorband[3];
4171 sampleStrength = proximity_factor;
4174 sampleStrength *= sample_factor;
4183 float brushPointVelocity[3];
4186 const int v1 = mloop[mlooptri[hitTri].
tri[0]].
v;
4187 const int v2 = mloop[mlooptri[hitTri].
tri[1]].
v;
4188 const int v3 = mloop[mlooptri[hitTri].
tri[2]].
v;
4198 brushVelocity[
v1].
v,
4199 brushVelocity[
v2].
v,
4200 brushVelocity[v3].
v,
4224 float sampleColor[3];
4225 float alpha_factor = 1.0f;
4227 sampleColor[0] = brush->
r;
4228 sampleColor[1] = brush->
g;
4229 sampleColor[2] = brush->
b;
4234 sampleColor[0] = prox_colorband[0];
4235 sampleColor[1] = prox_colorband[1];
4236 sampleColor[2] = prox_colorband[2];
4241 paintColor[0] += sampleColor[0];
4242 paintColor[1] += sampleColor[1];
4243 paintColor[2] += sampleColor[2];
4244 sampleStrength *= alpha_factor;
4249 brushStrength += sampleStrength;
4253 if (brushStrength > 0.0f || depth > 0.0f) {
4256 brushStrength /= total_sample;
4258 CLAMP(brushStrength, 0.0f, 1.0f);
4262 paintColor[0] /= numOfHits;
4263 paintColor[1] /= numOfHits;
4264 paintColor[2] /= numOfHits;
4272 surface, index, brush, paintColor, brushStrength, depth, velocity_val, timescale);
4297 if (brush_mesh ==
NULL) {
4303 float avg_brushNor[3] = {0.0f};
4319 for (ii = 0; ii < numOfVerts; ii++) {
4335 mul_v3_fl(avg_brushNor, 1.0f / (
float)numOfVerts);
4338 avg_brushNor[2] = 1.0f;
4347 int total_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
4350 for (c_index = 0; c_index < total_cells; c_index++) {
4352 if (!grid->
s_num[c_index] ||
4363 .timescale = timescale,
4368 .mlooptri = mlooptri,
4369 .brush_radius = brush_radius,
4370 .avg_brushNor = avg_brushNor,
4371 .brushVelocity = brushVelocity,
4372 .treeData = &treeData,
4378 grid->
s_num[c_index],
4391 if (brushVelocity) {
4415 const float timescale =
data->timescale;
4416 const int c_index =
data->c_index;
4420 const float solidradius =
data->solidradius;
4422 const float range = solidradius + smooth;
4423 const float particle_timestep = 0.04f * psys->
part->
timetweak;
4426 float disp_intersect = 0.0f;
4427 float radius = 0.0f;
4428 float strength = 0.0f;
4429 int part_index = -1;
4436 KDTreeNearest_3d nearest;
4437 float smooth_range, part_solidradius;
4442 if (nearest.dist > range) {
4449 part_solidradius = pa->
size;
4452 part_solidradius = solidradius;
4454 radius = part_solidradius + smooth;
4455 if (nearest.dist < radius) {
4457 smooth_range =
max_ff(0.0f, (nearest.dist - part_solidradius));
4460 smooth_range /= smooth;
4463 strength = 1.0f - smooth_range;
4464 disp_intersect = radius - nearest.dist;
4465 part_index = nearest.index;
4474 KDTreeNearest_3d *nearest;
4476 float smooth_range = smooth * (1.0f - strength), dist;
4478 const float max_range = smooth - strength * smooth + solidradius;
4482 const int particles = BLI_kdtree_3d_range_search(
4486 for (
int n = 0; n < particles; n++) {
4490 if (nearest[n].dist > (pa->
size + smooth)) {
4495 const float s_range = nearest[n].dist - pa->
size;
4497 if (smooth_range < s_range) {
4502 smooth_range = s_range;
4503 dist = nearest[n].dist;
4504 part_index = nearest[n].index;
4507 if ((s_range < 0.0f) &&
4518 const float rad = radius + smooth;
4519 if ((rad - dist) > disp_intersect) {
4520 disp_intersect = radius - dist;
4527 smooth_range /= smooth;
4530 const float str = 1.0f - smooth_range;
4532 if (
str > strength) {
4537 if (strength > 0.001f) {
4538 float paintColor[4] = {0.0f};
4540 float velocity_val = 0.0f;
4567 disp_intersect = (1.0f -
sqrtf(disp_intersect / radius)) * radius;
4572 surface, index, brush, paintColor, strength, depth, velocity_val, timescale);
4587 int particlesAdded = 0;
4588 int invalidParticles = 0;
4596 const float range = solidradius + smooth;
4620 if (
isnan(pa->state.co[0]) ||
isnan(pa->state.co[1]) ||
isnan(pa->state.co[2])) {
4630 BLI_kdtree_3d_insert(
tree, p, pa->state.co);
4637 if (invalidParticles) {
4642 if (particlesAdded < 1) {
4643 BLI_kdtree_3d_free(
tree);
4650 int total_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
4653 BLI_kdtree_3d_balance(
tree);
4656 for (c_index = 0; c_index < total_cells; c_index++) {
4667 .solidradius = solidradius,
4668 .timescale = timescale,
4676 grid->
s_num[c_index],
4682 BLI_kdtree_3d_free(
tree);
4700 const float timescale =
data->timescale;
4702 const float brush_radius =
data->brush_radius;
4703 const Vec3f *brushVelocity =
data->brushVelocity;
4705 float *pointCoord =
data->pointCoord;
4708 float colorband[4] = {0.0f};
4717 strength = 1.0f -
distance / brush_radius;
4718 CLAMP(strength, 0.0f, 1.0f);
4724 if (strength >= 0.001f) {
4725 float paintColor[3] = {0.0f};
4727 float velocity_val = 0.0f;
4732 strength = colorband[3];
4745 velocity_val =
len_v3(velocity);
4758 paintColor[0] = colorband[0];
4759 paintColor[1] = colorband[1];
4760 paintColor[2] = colorband[2];
4763 paintColor[0] = brush->
r;
4764 paintColor[1] = brush->
g;
4765 paintColor[2] = brush->
b;
4770 const float disp_intersect = (1.0f -
sqrtf((brush_radius -
distance) / brush_radius)) *
4775 surface, index, brush, paintColor, strength, depth, velocity_val, timescale);
4809 .timescale = timescale,
4811 .brush_radius = brush_radius,
4812 .brushVelocity = &brushVel,
4813 .pointCoord = pointCoord,
4840 const int num_neighs = adj_data->
n_num[index];
4842 for (
int i = 0; i < num_neighs; i++) {
4843 const int n_index = adj_data->
n_index[index] + i;
4844 const int t_index = adj_data->
n_target[n_index];
4848 realCoord[bData->
s_pos[t_index]].
v,
4849 realCoord[bData->
s_pos[index]].
v);
4887 for (index = 0; index < sData->
total_points; index++) {
4888 int numOfNeighs = adj_data->
n_num[index];
4890 for (
int i = 0; i < numOfNeighs; i++) {
4901 const float force[3],
4908 closest_id[0] = closest_id[1] = -1;
4909 closest_d[0] = closest_d[1] = -1.0f;
4912 for (
int i = 0; i < numOfNeighs; i++) {
4914 const float dir_dot =
dot_v3v3(bNeighs[n_index].dir, force);
4916 if (dir_dot > closest_d[0] && dir_dot > 0.0f) {
4917 closest_d[0] = dir_dot;
4918 closest_id[0] = n_index;
4922 if (closest_d[0] < 0.0f) {
4927 for (
int i = 0; i < numOfNeighs; i++) {
4930 if (n_index == closest_id[0]) {
4934 const float dir_dot =
dot_v3v3(bNeighs[n_index].dir, force);
4935 const float closest_dot =
dot_v3v3(bNeighs[n_index].dir, bNeighs[closest_id[0]].dir);
4939 if (dir_dot > closest_d[1] && closest_dot < closest_d[0] && dir_dot > 0.0f) {
4940 closest_d[1] = dir_dot;
4941 closest_id[1] = n_index;
4947 if (closest_id[1] != -1) {
4948 float force_proj[3];
4950 const float neigh_diff =
acosf(
4951 dot_v3v3(bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir));
4952 float force_intersect;
4957 cross_v3_v3v3(tangent, bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir);
4959 force_intersect =
dot_v3v3(force, tangent);
4960 madd_v3_v3v3fl(force_proj, force, tangent, (-1.0f) * force_intersect);
4964 temp =
dot_v3v3(bNeighs[closest_id[0]].dir, force_proj);
4965 CLAMP(temp, -1.0f, 1.0f);
4966 closest_d[1] =
acosf(temp) / neigh_diff;
4967 closest_d[0] = 1.0f - closest_d[1];
4970 temp =
fabsf(force_intersect);
4971 CLAMP(temp, 0.0f, 1.0f);
4987 float max_velocity = 0.0f;
4994 for (
int index = 0; index < sData->
total_points; index++) {
5003 for (
int step = 0; step <
steps; step++) {
5004 for (
int index = 0; index < sData->
total_points; index++) {
5023 sData, index, &bData->
brush_velocity[index * 4], closest_d, closest_id);
5026 for (
int i = 0; i < 2; i++) {
5027 int n_index = closest_id[i];
5028 if (n_index != -1 && closest_d[i] > 0.0f) {
5029 float dir_dot = closest_d[i], dir_factor;
5030 float speed_scale = eff_scale * smudge_str / bNeighs[n_index].
dist;
5035 if (dir_dot <= 0.0f) {
5039 dir_factor = dir_dot * speed_scale;
5044 ePoint->
color[3] = ePoint->
color[3] * (1.0f - dir_factor) +
5045 pPoint->
color[3] * dir_factor;
5054 pPoint->
e_color[3] * dir_factor;
5055 pPoint->
wetness *= (1.0f - dir_factor);
5100 float *force =
data->force;
5103 float forc[3] = {0};
5120 surface->effector_weights->global_gravity *
surface->effector_weights->weight[0] /
5150 double average_force = 0.0f;
5151 float shrink_speed = 0.0f, spread_speed = 0.0f;
5152 float fastest_effect, avg_dist;
5170 .effectors = effectors,
5179 for (
int index = 0; index < sData->
total_points; index++) {
5180 average_force += (
double)(*force)[index * 4 + 3];
5192 spread_speed =
surface->spread_speed;
5195 shrink_speed =
surface->shrink_speed;
5198 fastest_effect =
max_fff(spread_speed, shrink_speed, average_force);
5227 const float eff_scale =
data->eff_scale;
5233 for (
int i = 0; i < numOfNeighs; i++) {
5234 const int n_idx = n_index[index] + i;
5236 const PaintPoint *pPoint_prev = &prevPoint[n_target[n_idx]];
5237 const float speed_scale = (bNeighs[n_idx].
dist < eff_scale) ? 1.0f :
5238 eff_scale / bNeighs[n_idx].dist;
5256 w_factor = 1.0f / numOfNeighs *
min_ff(pPoint_prev->
wetness, 1.0f) * speed_scale;
5257 CLAMP(w_factor, 0.0f, 1.0f);
5286 const float eff_scale =
data->eff_scale;
5287 float totalAlpha = 0.0f;
5293 for (
int i = 0; i < numOfNeighs; i++) {
5294 const int n_idx = n_index[index] + i;
5295 const float speed_scale = (bNeighs[n_idx].
dist < eff_scale) ? 1.0f :
5296 eff_scale / bNeighs[n_idx].dist;
5297 const PaintPoint *pPoint_prev = &prevPoint[n_target[n_idx]];
5298 float a_factor, ea_factor, w_factor;
5300 totalAlpha += pPoint_prev->
e_color[3];
5309 a_factor =
max_ff((1.0f - pPoint_prev->
color[3]) / numOfNeighs *
5310 (pPoint->
color[3] - pPoint_prev->
color[3]) * speed_scale,
5321 pPoint->
color[3] -= a_factor;
5323 pPoint->
e_color[3] -= ea_factor;
5346 const PaintPoint *pPoint_prev = &prevPoint[index];
5347 const float *force =
data->force;
5348 const float eff_scale =
data->eff_scale;
5358 float w_factor = pPoint_prev->
wetness - 0.025f;
5359 if (w_factor <= 0) {
5362 CLAMP(w_factor, 0.0f, 1.0f);
5364 float ppoint_wetness_diff = 0.0f;
5370 for (
int i = 0; i < 2; i++) {
5371 const int n_idx = closest_id[i];
5372 if (n_idx != -1 && closest_d[i] > 0.0f) {
5373 const float dir_dot = closest_d[i];
5376 if (dir_dot <= 0.0f) {
5380 float dir_factor, a_factor;
5381 const float speed_scale = eff_scale * force[index * 4 + 3] / bNeighs[n_idx].
dist;
5383 const unsigned int n_trgt = (
unsigned int)n_target[n_idx];
5388 const unsigned int epointlock_idx = n_trgt / 8;
5389 const uint8_t epointlock_bitmask = 1 << (n_trgt & 7);
5391 epointlock_bitmask) {
5396 const float e_wet = ePoint->
wetness;
5398 dir_factor =
min_ff(0.5f, dir_dot *
min_ff(speed_scale, 1.0f) * w_factor);
5401 ePoint->
wetness += dir_factor;
5405 a_factor = dir_factor / pPoint_prev->
wetness;
5406 CLAMP(a_factor, 0.0f, 1.0f);
5420 ppoint_wetness_diff += (ePoint->
wetness - e_wet);
5425 ~epointlock_bitmask);
5435 const unsigned int ppointlock_idx = index / 8;
5436 const uint8_t ppointlock_bitmask = 1 << (index & 7);
5438 ppointlock_bitmask) {
5442 pPoint->
wetness -= ppoint_wetness_diff;
5486 .prevPoint = prevPoint,
5487 .eff_scale = eff_scale,
5508 .prevPoint = prevPoint,
5509 .eff_scale = eff_scale,
5525 const size_t point_locks_size = (sData->
total_points / 8) + 1;
5526 uint8_t *point_locks =
MEM_callocN(
sizeof(*point_locks) * point_locks_size, __func__);
5533 .prevPoint = prevPoint,
5534 .eff_scale = eff_scale,
5536 .point_locks = point_locks,
5566 float mix_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
5567 float mix_e_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
5568 float mix_wetness = 0.0f;
5570 for (
int i = 0; i < numOfNeighs; i++) {
5571 const int n_idx = n_index[index] + i;
5572 const int target = n_target[n_idx];
5579 mix_color[3] += pPoint2->
color[3];
5582 mix_e_color[3] += pPoint2->
e_color[3];
5584 mix_wetness += pPoint2->
wetness;
5587 const float divisor = 1.0f / numOfNeighs;
5590 pPoint->
color[3] = mix_color[3] * divisor;
5594 pPoint->
color[3] = 0.0f;
5597 if (mix_e_color[3]) {
5598 pPoint->
e_color[3] = mix_e_color[3] * divisor;
5605 pPoint->
wetness = mix_wetness / numOfNeighs;
5639 const float wave_speed =
data->wave_speed;
5640 const float wave_scale =
data->wave_scale;
5641 const float wave_max_slope =
data->wave_max_slope;
5643 const float dt =
data->dt;
5644 const float min_dist =
data->min_dist;
5645 const float damp_factor =
data->damp_factor;
5649 float force = 0.0f, avg_dist = 0.0f, avg_height = 0.0f, avg_n_height = 0.0f;
5650 int numOfN = 0, numOfRN = 0;
5652 if (wPoint->
state > 0) {
5661 for (
int i = 0; i < numOfNeighs; i++) {
5662 const int n_idx = n_index[index] + i;
5663 float dist = bNeighs[n_idx].
dist * wave_scale;
5666 if (!dist || tPoint->
state > 0) {
5676 avg_n_height += tPoint->
height;
5680 force += (tPoint->
height - wPoint->
height) / (dist * dist);
5681 avg_height += tPoint->
height;
5683 avg_dist = (numOfN) ? avg_dist / numOfN : 0.0f;
5687 avg_n_height = (numOfRN) ? avg_n_height / numOfRN : 0.0f;
5688 wPoint->
height = (dt * wave_speed * avg_n_height + wPoint->
height * avg_dist) /
5689 (avg_dist + dt * wave_speed);
5695 force += (0.0f - wPoint->
height) *
surface->wave_spring / (avg_dist * avg_dist) / 2.0f;
5699 wPoint->
velocity += force * dt * wave_speed * wave_speed;
5706 if (wave_max_slope && avg_dist) {
5707 const float max_offset = wave_max_slope * avg_dist;
5708 const float offset = (numOfN) ? (avg_height / numOfN - wPoint->
height) : 0.0f;
5709 if (offset > max_offset) {
5710 wPoint->
height += offset - max_offset;
5712 else if (offset < -max_offset) {
5713 wPoint->
height += offset + max_offset;
5718 if (
data->reset_wave) {
5733 float dt, min_dist, damp_factor;
5734 const float wave_speed =
surface->wave_speed;
5735 const float wave_max_slope = (
surface->wave_smoothness >= 0.01f) ?
5736 (0.5f /
surface->wave_smoothness) :
5738 double average_dist = 0.0f;
5749 for (index = 0; index < sData->
total_points; index++) {
5752 for (
int i = 0; i < numOfNeighs; i++) {
5760 (average_dist / (
double)wave_speed / 3));
5766 min_dist = wave_speed * dt * 1.5f;
5767 damp_factor =
pow((1.0f -
surface->wave_damping), timescale *
surface->wave_timescale);
5769 for (ss = 0; ss <
steps; ss++) {
5775 .prevPoint = prevPoint,
5776 .wave_speed = wave_speed,
5777 .wave_scale = wave_scale,
5778 .wave_max_slope = wave_max_slope,
5780 .min_dist = min_dist,
5781 .damp_factor = damp_factor,
5782 .reset_wave = (ss ==
steps - 1),
5815 const float timescale =
data->timescale;
5824 float p_wetness = pPoint->
wetness;
5833 float dry_ratio = pPoint->
wetness / p_wetness;
5846 pPoint->
e_color[3] *= dry_ratio;
5852 if (pPoint->
color[3]) {
5853 for (
int i = 0; i < 3; i++) {
5854 pPoint->
color[i] = (f_color[i] * f_color[3] -
5864 else if (pPoint->
state > 0) {
5893 float *point = &((
float *)sData->
type_data)[index];
5920 for (
int i = 0; i < numOfVerts; i++) {
5955 const Vec3f *canvas_verts =
data->canvas_verts;
5957 const bool do_velocity_data =
data->do_velocity_data;
5958 const bool new_bdata =
data->new_bdata;
5960 float prev_point[3] = {0.0f, 0.0f, 0.0f};
5963 if (do_velocity_data && !new_bdata) {
5971 float n1[3], n2[3], n3[3];
5976 bData->
s_pos[index] = index * bData->
s_num[index];
5979 for (
int ss = 0; ss < bData->
s_num[index]; ss++) {
5981 canvas_verts[tPoint->v1].
v,
5982 canvas_verts[tPoint->v2].
v,
5983 canvas_verts[tPoint->v3].
v,
5998 float scaled_nor[3];
6009 bData->
s_num[index] = adj_data->
n_num[index] + 1;
6010 bData->
s_pos[index] = adj_data->
n_index[index] + index;
6013 bData->
s_num[index] = 1;
6014 bData->
s_pos[index] = index;
6018 for (ss = 0; ss < bData->
s_num[index]; ss++) {
6022 int t_index = adj_data->
n_index[index] + (ss - 1);
6026 canvas_verts[adj_data->
n_target[t_index]].
v,
6036 float scaled_nor[3];
6046 if (do_velocity_data && !new_bdata && !bData->
clear) {
6059 bool new_bdata =
false;
6067 Vec3f *canvas_verts;
6078 if (do_velocity_data && bData->
velocity && (bData->
clear || !surface_moved)) {
6083 if (!surface_moved) {
6089 "Dynamic Paint transformed canvas verts");
6090 if (!canvas_verts) {
6097 "Dynamic Paint bake data");
6109 "Dynamic Paint bData s_pos");
6111 "Dynamic Paint bData s_num");
6113 "Dynamic Paint point coords");
6115 "Dynamic Paint bData prev_verts");
6141 if (do_velocity_data && !bData->
velocity) {
6143 "Dynamic Paint velocity");
6147 "Dynamic Paint prev velocity");
6158 for (index = 0; index < canvasNumOfVerts; index++) {
6159 copy_v3_v3(canvas_verts[index].
v, mvert[index].co);
6171 .canvas_verts = canvas_verts,
6172 .do_velocity_data = do_velocity_data,
6173 .new_bdata = new_bdata,
6220 .timescale = timescale,
6233 unsigned int numobjects;
6241 for (
int i = 0; i < numobjects; i++) {
6242 Object *brushObj = objects[i];
6255 "Dynamic Paint brush velocity");
6301 else if (brushObj != ob) {
6345 float *force =
NULL;
6349 "PaintSurfaceDataCopy");
6351 return setError(canvas,
N_(
"Not enough free memory"));
6356 for (s = 0; s <
steps; s++) {
6387 float timescale = 1.0f;
6400 timescale = 1.0f / (
surface->substeps + 1);
6402 for (st = 1; st <=
surface->substeps; st++) {
6403 float subframe = ((
float)st) / (
surface->substeps + 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)
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, const float m_dist, const float v0[3], const float v1[3], const float v2[3])
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)
struct ColorBand * BKE_colorband_add(bool rangetype)
bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4])
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_has_layer(const struct CustomData *data, int type)
int CustomData_get_named_layer_index(const struct CustomData *data, int type, const char *name)
void * CustomData_add_layer_named(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem, const char *name)
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 * CustomData_add_layer(struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem)
void CustomData_validate_layer_name(const struct CustomData *data, int type, const char *name, char *outname)
struct PaintPoint PaintPoint
struct PaintWavePoint PaintWavePoint
#define DPAINT_WAVE_ISECT_CHANGED
#define DPAINT_WAVE_REFLECT_ONLY
#define DPAINT_WAVE_OBSTACLE
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)
struct ImagePool * BKE_image_pool_new(void)
void BKE_image_pool_free(struct ImagePool *pool)
int BKE_image_path_ensure_ext_from_imtype(char *string, const char imtype)
void BKE_id_free(struct Main *bmain, void *idv)
const char * BKE_main_blendfile_path_from_global(void)
General operations, lookup, etc. for materials.
struct Mesh * BKE_mesh_copy_for_eval(struct Mesh *source, bool reference)
void BKE_mesh_vert_looptri_map_create(MeshElemMap **r_map, int **r_mem, const struct MVert *mvert, const int totvert, const struct MLoopTri *mlooptri, const int totlooptri, const struct MLoop *mloop, const int totloop)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh)
int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh)
void BKE_modifier_path_init(char *path, int path_maxlen, const char *name)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
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 psys_check_enabled(struct Object *ob, struct ParticleSystem *psys, const bool use_render_params)
void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
void BKE_ptcache_validate(struct PointCache *cache, int framenr)
void BKE_ptcache_id_from_dynamicpaint(PTCacheID *pid, struct Object *ob, struct DynamicPaintSurface *surface)
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode)
struct PointCache * BKE_ptcache_add(struct ListBase *ptcaches)
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old)
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
void BKE_ptcache_free_list(struct ListBase *ptcaches)
#define PTCACHE_RESET_OUTDATED
float BKE_scene_frame_get(const struct Scene *scene)
bool BKE_scene_check_color_management_enabled(const struct Scene *scene)
#define BVH_RAYCAST_DIST_MAX
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)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float max_fff(float a, float b, float c)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE float square_f(float a)
MINLINE float min_fff(float a, float b, float c)
void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4])
void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
void barycentric_weights_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3])
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 closest_on_tri_to_point_v3(float r[3], const float p[3], const float v1[3], const float v2[3], const float v3[3])
float closest_to_line_v2(float r_close[2], const float p[2], const float l1[2], const float l2[2])
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
void mul_m4_v3(const float M[4][4], float r[3])
bool equals_m4m4(const float mat1[4][4], const float mat2[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void copy_v4_v4(float r[4], const float a[4])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[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 madd_v2_v2v2fl(float r[2], const float a[2], const float b[2], float f)
MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3(float r[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 float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
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_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
void minmax_v2v2_v2(float min[2], float max[2], const float vec[2])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE bool equals_v2v2(const float v1[2], const float v2[2]) ATTR_WARN_UNUSED_RESULT
void interp_v4_v4v4v4(float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
MINLINE void negate_v3(float r[3])
MINLINE float normalize_v3_v3(float r[3], const float a[3])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]) ATTR_WARN_UNUSED_RESULT
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 madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
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
bool BLI_make_existing_file(const char *name)
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
bool BLI_uniquename_cb(UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_len)
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 BLT_I18NCONTEXT_ID_BRUSH
#define CTX_DATA_(context, msgid)
typedef double(DMatrix)[4][4]
#define CLOG_WARN(clg_ref,...)
#define CLOG_STR_ERROR(clg_ref, str)
#define CLOG_INFO(clg_ref, level,...)
struct Depsgraph Depsgraph
eEvaluationMode DEG_get_mode(const Depsgraph *graph)
Object groups, one object can be in many groups at once.
#define MAX_CUSTOMDATA_LAYER_NAME
@ MOD_DPAINT_DISP_DISPLACE
@ MOD_DPAINT_INITIAL_NONE
@ MOD_DPAINT_INITIAL_VERTEXCOLOR
@ MOD_DPAINT_INITIAL_COLOR
@ MOD_DPAINT_INITIAL_TEXTURE
@ MOD_DPAINT_EFFECT_DO_DRIP
@ MOD_DPAINT_EFFECT_DO_SPREAD
@ MOD_DPAINT_EFFECT_DO_SHRINK
@ MOD_DPAINT_WAVE_OPEN_BORDERS
@ MOD_DPAINT_DISP_INCREMENTAL
@ MOD_DPAINT_DISSOLVE_LOG
@ MOD_DPAINT_WAVEB_REFLECT
@ MOD_DPAINT_WAVEB_CHANGE
@ MOD_DPAINT_RAY_BRUSH_AVG
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_T_DISPLACE
@ MOD_DPAINT_SURFACE_T_WAVE
@ MOD_DPAINT_IMGFORMAT_OPENEXR
@ MOD_DPAINT_IMGFORMAT_PNG
@ MOD_DPAINT_PRFALL_CONSTANT
@ MOD_DPAINT_PRFALL_SMOOTH
@ MOD_DPAINT_SURFACE_F_PTEX
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ MOD_DPAINT_PROX_PROJECT
@ MOD_DPAINT_INVERSE_PROX
@ MOD_DPAINT_USES_VELOCITY
@ MOD_DPAINT_VELOCITY_ALPHA
@ MOD_DPAINT_VELOCITY_DEPTH
@ MOD_DPAINT_VELOCITY_COLOR
@ MOD_DPAINT_NEGATE_VOLUME
@ eModifierFlag_SharedCaches
@ eModifierType_DynamicPaint
@ MOD_DYNAMICPAINT_TYPE_BRUSH
@ MOD_DYNAMICPAINT_TYPE_CANVAS
Object is a sort of wrapper for general info.
@ PART_FLUID_SPRAYFOAMBUBBLE
#define PTCACHE_REDO_NEEDED
#define PTCACHE_DISK_CACHE
#define PHYS_GLOBAL_GRAVITY
#define R_IMF_IMTYPE_OPENEXR
_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 GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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 height
_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
struct ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
void IMB_freeImBuf(struct ImBuf *ibuf)
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Group RGB to Bright Vector Camera CLAMP
Provides wrapper around system-specific atomic primitives, and some extensions (faked-atomic operatio...
ATOMIC_INLINE uint8_t atomic_fetch_and_and_uint8(uint8_t *p, uint8_t b)
ATOMIC_INLINE uint8_t atomic_fetch_and_or_uint8(uint8_t *p, uint8_t b)
ATOMIC_INLINE uint32_t atomic_add_and_fetch_uint32(uint32_t *p, uint32_t x)
static CCL_NAMESPACE_BEGIN int aa_samples(Scene *scene, Object *object, ShaderEvalType type)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static char * basename(char *string)
const Depsgraph * depsgraph
static bool dynamicPaint_checkSurfaceData(const Scene *scene, DynamicPaintSurface *surface)
int dynamicPaint_calculateFrame(DynamicPaintSurface *surface, struct Depsgraph *depsgraph, Scene *scene, Object *cObject, int frame)
static bool dynamicPaint_paintMesh(Depsgraph *depsgraph, DynamicPaintSurface *surface, DynamicPaintBrushSettings *brush, Object *brushOb, Scene *scene, float timescale)
void dynamicPaint_clearSurface(const Scene *scene, DynamicPaintSurface *surface)
static int dynamic_paint_find_neighbor_pixel(const DynamicPaintCreateUVSurfaceData *data, const MeshElemMap *vert_to_looptri_map, const int w, const int h, const int px, const int py, const int n_index)
struct PaintBakeNormal PaintBakeNormal
static void freeGrid(PaintSurfaceData *data)
static void dynamicPaint_mixPaintColors(const DynamicPaintSurface *surface, const int index, const int paintFlags, const float paintColor[3], const float paintAlpha, const float paintWetness, const float timescale)
static bool surface_usesAdjDistance(DynamicPaintSurface *surface)
static void dynamic_paint_apply_surface_vpaint_blend_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_generate_bake_data_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_doSmudge(DynamicPaintSurface *surface, DynamicPaintBrushSettings *brush, float timescale)
static void dynamic_paint_border_cb(void *__restrict userdata, const int b_index, const TaskParallelTLS *__restrict UNUSED(tls))
static void free_bakeData(PaintSurfaceData *data)
static void grid_cell_points_reduce(const void *__restrict userdata, void *__restrict chunk_join, void *__restrict chunk)
static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface, float *force, PaintPoint *prevPoint, float timescale, float steps)
static void scene_setSubframe(Scene *scene, float subframe)
static const float gaussianTotal
static void dynamic_paint_set_init_color_tex_to_vcol_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_apply_surface_displace_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_mixWaveHeight(PaintWavePoint *wPoint, const DynamicPaintBrushSettings *brush, float isect_height)
static bool boundsIntersect(Bounds3D *b1, Bounds3D *b2)
static bool dynamicPaint_surfaceHasMoved(DynamicPaintSurface *surface, Object *ob)
void dynamicPaint_freeSurface(const DynamicPaintModifierData *pmd, DynamicPaintSurface *surface)
static void grid_bound_insert_cb_ex(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls)
static const float gaussianFactors[5]
static void dynamicPaint_setInitialColor(const Scene *scene, DynamicPaintSurface *surface)
struct DynamicPaintDissolveDryData DynamicPaintDissolveDryData
struct DynamicPaintBrushVelocityData DynamicPaintBrushVelocityData
static void dynamic_paint_output_surface_image_wetmap_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
struct PaintUVPoint PaintUVPoint
static Mesh * dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, Object *ob, Mesh *mesh)
static bool boundIntersectPoint(Bounds3D *b, const float point[3], const float radius)
static void dynamic_paint_output_surface_image_displace_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_frameUpdate(DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh)
void dynamicPaintSurface_updateType(struct DynamicPaintSurface *surface)
static float dist_squared_to_looptri_uv_edges(const MLoopTri *mlooptri, const MLoopUV *mloopuv, int tri_index, const float point[2])
static void dynamic_paint_create_uv_surface_direct_cb(void *__restrict userdata, const int ty, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_find_island_border(const DynamicPaintCreateUVSurfaceData *data, DynamicPaintFindIslandBorderData *bdata, int tri_index, const float pixel[2], int in_edge, int depth)
static void surface_freeUnusedData(DynamicPaintSurface *surface)
static void surface_setUniqueOutputName(DynamicPaintSurface *surface, char *basename, int output)
static void dynamic_paint_paint_particle_cell_point_cb_ex(void *__restrict userdata, const int id, const TaskParallelTLS *__restrict UNUSED(tls))
bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene)
static void dynamic_paint_effect_spread_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
void dynamicPaintSurface_setUniqueName(DynamicPaintSurface *surface, const char *basename)
void dynamicPaint_cacheUpdateFrames(DynamicPaintSurface *surface)
static bool dynamicPaint_symmetrizeAdjData(PaintAdjData *ed, int active_points)
static void dynamic_paint_apply_surface_vpaint_cb(void *__restrict userdata, const int p_index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_effect_drip_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static int neighStraightX[8]
static void dynamicPaint_allocateSurfaceType(DynamicPaintSurface *surface)
#define EFF_MOVEMENT_PER_FRAME
static void dynamicPaint_doWaveStep(DynamicPaintSurface *surface, float timescale)
struct PaintBakeData PaintBakeData
static void dynamicPaint_doBorderStep(DynamicPaintSurface *surface)
struct DynamicPaintFindIslandBorderData DynamicPaintFindIslandBorderData
struct DynamicPaintGenerateBakeData DynamicPaintGenerateBakeData
static void dynamic_paint_brush_velocity_compute_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static void mesh_tris_nearest_point_dp(void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
static void dynamicPaint_prepareAdjacencyData(DynamicPaintSurface *surface, const bool force_init)
static bool setError(DynamicPaintCanvasSettings *canvas, const char *string)
static Mesh * dynamicPaint_canvas_mesh_get(DynamicPaintCanvasSettings *canvas)
static bool dynamic_paint_surface_needs_dry_dissolve(DynamicPaintSurface *surface)
static void dynamicPaint_brushMeshCalculateVelocity(Depsgraph *depsgraph, Scene *scene, Object *ob, DynamicPaintBrushSettings *brush, Vec3f **brushVel, float timescale)
void dynamicPaint_freeBrush(struct DynamicPaintModifierData *pmd)
static void dynamic_paint_paint_single_point_cb_ex(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_set_init_color_vcol_to_imseq_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_effect_shrink_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void surface_determineForceTargetPoints(const PaintSurfaceData *sData, const int index, const float force[3], float closest_d[2], int closest_id[2])
bool dynamicPaint_resetSurface(const Scene *scene, DynamicPaintSurface *surface)
int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, float *progress, short *do_update)
BLI_INLINE void value_dissolve(float *r_value, const float time, const float scale, const bool is_log)
static float getSurfaceDimension(PaintSurfaceData *sData)
static int surface_totalSamples(DynamicPaintSurface *surface)
static bool dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Depsgraph *depsgraph, Object *ob)
#define SUBFRAME_RECURSION
struct VolumeGrid VolumeGrid
struct DynamicPaintModifierApplyData DynamicPaintModifierApplyData
static void dynamic_paint_prepare_adjacency_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_wave_step_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_brushObjectCalculateVelocity(Depsgraph *depsgraph, Scene *scene, Object *ob, Vec3f *brushVel, float timescale)
static void dynamicPaint_applySurfaceDisplace(DynamicPaintSurface *surface, Mesh *result)
struct PaintAdjData PaintAdjData
static bool boundsIntersectDist(Bounds3D *b1, Bounds3D *b2, const float dist)
DynamicPaintSurface * get_activeSurface(DynamicPaintCanvasSettings *canvas)
static void grid_cell_points_cb_ex(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict tls)
static void mesh_tris_spherecast_dp(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
struct DynamicPaintOutputSurfaceImageData DynamicPaintOutputSurfaceImageData
static void canvas_copyMesh(DynamicPaintCanvasSettings *canvas, Mesh *mesh)
struct DynamicPaintPaintData DynamicPaintPaintData
static void boundInsert(Bounds3D *b, const float point[3])
struct DynamicPaintEffectData DynamicPaintEffectData
static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
static void grid_cell_bounds_cb(void *__restrict userdata, const int x, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamic_paint_prepare_effect_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, const bool force_init)
static bool surface_duplicateOutputExists(void *arg, const char *name)
void dynamicPaint_freeSurfaceData(DynamicPaintSurface *surface)
static int surface_getBrushFlags(DynamicPaintSurface *surface, Depsgraph *depsgraph)
struct ImgSeqFormatData ImgSeqFormatData
static void dynamic_paint_create_uv_surface_neighbor_cb(void *__restrict userdata, const int ty, const TaskParallelTLS *__restrict UNUSED(tls))
#define BRUSH_USES_VELOCITY
static bool dynamicPaint_paintParticles(DynamicPaintSurface *surface, ParticleSystem *psys, DynamicPaintBrushSettings *brush, float timescale)
static bool meshBrush_boundsIntersect(Bounds3D *b1, Bounds3D *b2, DynamicPaintBrushSettings *brush, float brush_radius)
static void dynamic_paint_apply_surface_wave_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
void dynamicPaint_Modifier_free(DynamicPaintModifierData *pmd)
static DynamicPaintRuntime * dynamicPaint_Modifier_runtime_ensure(DynamicPaintModifierData *pmd)
struct DynamicPaintCreateUVSurfaceData DynamicPaintCreateUVSurfaceData
static void blendColors(const float t_color[3], const float t_alpha, const float s_color[3], const float s_alpha, float result[4])
Mesh * dynamicPaint_Modifier_do(DynamicPaintModifierData *pmd, struct Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh)
static int dynamicPaint_doStep(Depsgraph *depsgraph, Scene *scene, Object *ob, DynamicPaintSurface *surface, float timescale, float subframe)
static bool dynamicPaint_paintSinglePoint(Depsgraph *depsgraph, DynamicPaintSurface *surface, float *pointCoord, DynamicPaintBrushSettings *brush, Object *brushOb, Scene *scene, float timescale)
struct BakeAdjPoint BakeAdjPoint
static int neighStraightY[8]
void dynamicPaint_freeCanvas(DynamicPaintModifierData *pmd)
static bool surface_duplicateNameExists(void *arg, const char *name)
struct DynamicPaintSetInitColorData DynamicPaintSetInitColorData
static Mesh * dynamicPaint_brush_mesh_get(DynamicPaintBrushSettings *brush)
static void dynamic_paint_output_surface_image_wave_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static bool dynamicPaint_pointHasNeighbor(PaintAdjData *ed, int index, int neighbor)
void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd, struct DynamicPaintModifierData *tpmd, int flag)
static int dynamicPaint_prepareEffectStep(struct Depsgraph *depsgraph, DynamicPaintSurface *surface, Scene *scene, Object *ob, float **force, float timescale)
static float mixColors(float a_color[3], float a_weight, const float b_color[3], float b_weight, float ratio)
static void dynamic_paint_paint_mesh_cell_point_cb_ex(void *__restrict userdata, const int id, const TaskParallelTLS *__restrict UNUSED(tls))
static void grid_bound_insert_reduce(const void *__restrict UNUSED(userdata), void *__restrict chunk_join, void *__restrict chunk)
void dynamicPaint_Modifier_free_runtime(DynamicPaintRuntime *runtime_data)
static void dynamic_paint_set_init_color_tex_to_imseq_cb(void *__restrict userdata, const int i, const TaskParallelTLS *__restrict UNUSED(tls))
static bool surface_usesAdjData(DynamicPaintSurface *surface)
static int dynamicPaint_surfaceNumOfPoints(DynamicPaintSurface *surface)
bool dynamicPaint_outputLayerExists(struct DynamicPaintSurface *surface, Object *ob, int output)
DynamicPaintSurface * dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *canvas, Scene *scene)
static void dynamic_paint_output_surface_image_paint_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
static void dynamicPaint_updatePointData(const DynamicPaintSurface *surface, const int index, const DynamicPaintBrushSettings *brush, float paint[3], float influence, float depth, float vel_factor, const float timescale)
static void dynamicPaint_freeAdjData(PaintSurfaceData *data)
void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filename, short output_layer)
static void dynamic_paint_surface_pre_step_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
struct @203::@204 surface
IconTextureDrawCall normal
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
MINLINE unsigned char unit_float_to_uchar_clamp(float val)
static void error(const char *str)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
static void sample(SocketReader *reader, int x, int y, float color[4])
struct ColorBand * vel_ramp
struct DynamicPaintModifierData * pmd
struct ParticleSystem * psys
struct ColorBand * paint_ramp
struct DynamicPaintModifierData * pmd
const MLoopTri * mlooptri
PaintUVPoint * tempPoints
const DynamicPaintSurface * surface
const DynamicPaintSurface * surface
const float wave_max_slope
const DynamicPaintSurface * surface
const MeshElemMap * vert_to_looptri_map
const DynamicPaintSurface * surface
const bool do_velocity_data
const Vec3f * canvas_verts
const DynamicPaintSurface * surface
struct DynamicPaintCanvasSettings * canvas
struct DynamicPaintBrushSettings * brush
const DynamicPaintSurface * surface
const DynamicPaintBrushSettings * brush
const float * avg_brushNor
const ParticleSystem * psys
const MLoopTri * mlooptri
const DynamicPaintSurface * surface
const Vec3f * brushVelocity
struct Mesh * canvas_mesh
const MLoopTri * mlooptri
const bool scene_color_manage
const DynamicPaintSurface * surface
const MLoopCol * mloopcol
struct DynamicPaintCanvasSettings * canvas
struct Tex * init_texture
struct Collection * brush_group
float color_dry_threshold
char image_output_path[1024]
struct EffectorWeights * effector_weights
struct PointCache * pointcache
ImbFormatOptions foptions
struct CustomData pdata ldata
struct PointCache * cache
PaintBakeNormal * bNormal
struct PaintBakeData * bData
struct PaintAdjData * adj_data
unsigned int neighbor_pixel
struct PhysicsSettings physics_settings
TaskParallelReduceFunc func_reduce
size_t userdata_chunk_size
int multitex_ext_safe(Tex *tex, const float texvec[3], TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
ccl_device_inline float distance(const float2 &a, const float2 &b)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float2 floor(const float2 &a)
ccl_device_inline float3 ceil(const float3 &a)