91 static int neighX[8] = {1, 1, 0, -1, -1, -1, 0, 1};
92 static int neighY[8] = {0, 1, 1, 1, 0, -1, -1, -1};
99 #define SUBFRAME_RECURSION 5
101 #define BRUSH_USES_VELOCITY (1 << 0)
104 #define HIT_PROXIMITY 2
107 #define ON_MESH_EDGE -2
108 #define OUT_OF_TEXTURE -3
110 #define EFF_MOVEMENT_PER_FRAME 0.05f
112 #define WAVE_TIME_FAC (1.0f / 24.0f)
113 #define CANVAS_REL_SIZE 5.0f
115 #define MIN_WETNESS 0.001f
116 #define MAX_WETNESS 5.0f
125 (*r_value) - 1.0f /
time * scale;
230 #define ADJ_ON_MESH_EDGE (1 << 0)
231 #define ADJ_BORDER_PIXEL (1 << 1)
254 if (runtime_data ==
NULL) {
311 return (canvas_mesh) ? canvas_mesh->
totvert : 0;
384 sizeof(
surface->output_name2));
412 surface->output_name[0] =
'\0';
413 surface->output_name2[0] =
'\0';
418 strcpy(
surface->output_name,
"dp_");
425 strcat(
surface->output_name,
"paintmap");
426 strcat(
surface->output_name2,
"wetmap");
430 strcat(
surface->output_name,
"displace");
433 strcat(
surface->output_name,
"weight");
436 strcat(
surface->output_name,
"wave");
445 return (
surface->data->total_points * 5);
449 return (
surface->data->total_points +
surface->data->adj_data->total_targets);
452 return surface->data->total_points;
457 const float s_color[3],
462 float i_alpha = 1.0f - s_alpha;
463 float f_alpha = t_alpha * i_alpha + s_alpha;
467 for (
int i = 0; i < 3; i++) {
468 result[i] = (t_color[i] * t_alpha * i_alpha + s_color[i] * s_alpha) / f_alpha;
480 float a_color[3],
float a_weight,
const float b_color[3],
float b_weight,
float ratio)
482 float weight_ratio, factor;
487 return b_weight * ratio;
489 weight_ratio = b_weight / (a_weight + b_weight);
492 return a_weight * (1.0f - ratio);
497 factor = weight_ratio * (ratio * 2.0f);
500 ratio = (ratio * 2.0f - 1.0f);
501 factor = weight_ratio * (1.0f - ratio) + ratio;
505 return (1.0f - factor) * a_weight + factor * b_weight;
517 unsigned int numobjects;
523 for (
int i = 0; i < numobjects; i++) {
524 Object *brushObj = objects[i];
551 for (
int i = 2; i--;) {
552 if (!(b1->
min[i] <= b2->
max[i] && b1->
max[i] >= b2->
min[i])) {
565 for (
int i = 2; i--;) {
566 if (!(b1->
min[i] <= (b2->
max[i] + dist) && b1->
max[i] >= (b2->
min[i] - dist))) {
579 for (
int i = 2; i--;) {
580 if (!(
b->min[i] <= (
point[i] + radius) &&
b->max[i] >= (
point[i] - radius))) {
634 Bounds3D *grid_bound = tls->userdata_chunk;
640 void *__restrict chunk_join,
641 void *__restrict chunk)
657 int *s_num = tls->userdata_chunk;
661 for (
int j = 3; j--;) {
663 bData->
dim[j] * grid->
dim[j]);
667 temp_t_index[i] = co[0] + co[1] * grid->
dim[0] + co[2] * grid->
dim[0] * grid->
dim[1];
668 s_num[temp_t_index[i]]++;
672 void *__restrict chunk_join,
673 void *__restrict chunk)
677 const int grid_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
679 int *join_s_num = chunk_join;
683 for (
int i = 0; i < grid_cells; i++) {
684 join_s_num[i] += s_num[i];
694 float *dim = bData->
dim;
695 int *grid_dim = grid->
dim;
697 for (
int y = 0;
y < grid_dim[1];
y++) {
698 for (
int z = 0;
z < grid_dim[2];
z++) {
699 const int b_index =
x +
y * grid_dim[0] +
z * grid_dim[0] * grid_dim[1];
701 for (
int j = 3; j--;) {
702 const int s = (j == 0) ?
x : ((j == 1) ?
y :
z);
716 int grid_cells, axis = 3;
717 int *temp_t_index =
NULL;
718 int *temp_s_num =
NULL;
729 float dim_factor, volume, dim[3];
749 min_dim =
max_fff(td[0], td[1], td[2]) / 1000.0f;
752 for (i = 0; i < 3; i++) {
753 if (td[i] < min_dim) {
759 if (axis == 0 ||
max_fff(td[0], td[1], td[2]) < 0.0001f) {
766 volume = td[0] * td[1] * td[2];
773 for (i = 0; i < 3; i++) {
774 grid->
dim[i] = (int)
floor(td[i] / dim_factor);
775 CLAMP(grid->
dim[i], (dim[i] >= min_dim) ? 3 : 1, 100);
777 grid_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
781 grid->
s_pos =
MEM_callocN(
sizeof(
int) * grid_cells,
"Surface Grid Position");
784 temp_s_num =
MEM_callocN(
sizeof(
int) * grid_cells,
"Temp Surface Grid Points");
787 "Temp Surface Grid Target Ids");
808 for (i = 1; i < grid_cells; i++) {
814 int pos = grid->
s_pos[temp_t_index[i]] + temp_s_num[temp_t_index[i]];
817 temp_s_num[temp_t_index[i]]++;
860 if (
data->adj_data) {
861 if (
data->adj_data->n_index) {
864 if (
data->adj_data->n_num) {
867 if (
data->adj_data->n_target) {
870 if (
data->adj_data->flags) {
873 if (
data->adj_data->border) {
939 if (
data->format_data) {
953 if (
data->type_data) {
1024 surface->pointcache->step = 1;
1035 surface->color_dry_threshold = 1.0f;
1041 surface->influence_scale = 1.0f;
1044 surface->init_color[0] = 1.0f;
1045 surface->init_color[1] = 1.0f;
1046 surface->init_color[2] = 1.0f;
1047 surface->init_color[3] = 1.0f;
1049 surface->image_resolution = 256;
1062 surface->color_spread_speed = 1.0f;
1065 surface->wave_damping = 0.04f;
1067 surface->wave_timescale = 1.0f;
1069 surface->wave_smoothness = 1.0f;
1072 surface->image_output_path,
sizeof(
surface->image_output_path),
"cache_dynamicpaint");
1096 "DynamicPaint Canvas");
1127 brush->
alpha = 1.0f;
1152 ramp[0].
r = ramp[0].
g = ramp[0].
b = ramp[0].
a = 1.0f;
1154 ramp[1].
r = ramp[1].
g = ramp[1].
b = ramp[1].
pos = 1.0f;
1168 ramp[0].
r = ramp[0].
g = ramp[0].
b = ramp[0].
a = ramp[0].
pos = 0.0f;
1169 ramp[1].
r = ramp[1].
g = ramp[1].
b = ramp[1].
a = ramp[1].
pos = 1.0f;
1273 t_brush->
pmd = tpmd;
1275 t_brush->flags = brush->
flags;
1278 t_brush->r = brush->
r;
1279 t_brush->g = brush->
g;
1280 t_brush->b = brush->
b;
1281 t_brush->alpha = brush->
alpha;
1282 t_brush->wetness = brush->
wetness;
1291 t_brush->psys = brush->
psys;
1302 t_brush->ray_dir = brush->
ray_dir;
1319 "DynamicPaintSurface Data");
1323 "DynamicPaintSurface DepthData");
1327 "DynamicPaintSurface WeightData");
1331 "DynamicPaintSurface WaveData");
1359 int neigh_points = 0;
1373 if (!neigh_points) {
1410 for (
int i = 0; i < numOfEdges; i++) {
1411 ad->
n_num[edge[i].v1]++;
1412 ad->
n_num[edge[i].v2]++;
1414 temp_data[edge[i].v1]++;
1415 temp_data[edge[i].v2]++;
1420 for (
int i = 0; i < numOfPolys; i++) {
1421 for (
int j = 0; j < mpoly[i].
totloop; j++) {
1422 temp_data[mloop[mpoly[i].
loopstart + j].
v]++;
1429 if ((temp_data[i] % 2) || (temp_data[i] < 4)) {
1441 n_pos += ad->
n_num[i];
1445 for (
int i = 0; i < numOfEdges; i++) {
1447 int index = edge[i].v1;
1448 n_pos = ad->
n_index[index] + temp_data[index];
1454 n_pos = ad->
n_index[index] + temp_data[index];
1493 const bool scene_color_manage =
data->scene_color_manage;
1495 float uv[3] = {0.0f};
1497 for (
int j = 3; j--;) {
1499 const unsigned int vert = mloop[mlooptri[i].tri[j]].v;
1502 uv[0] = mloopuv[mlooptri[i].tri[j]].uv[0] * 2.0f - 1.0f;
1503 uv[1] = mloopuv[mlooptri[i].tri[j]].uv[1] * 2.0f - 1.0f;
1507 if (texres.
tin > pPoint[vert].color[3]) {
1509 pPoint[vert].color[3] = texres.
tin;
1528 const bool scene_color_manage =
data->scene_color_manage;
1530 float uv[9] = {0.0f};
1531 float uv_final[3] = {0.0f};
1536 for (
int j = 3; j--;) {
1537 copy_v2_v2(&uv[j * 3], mloopuv[mlooptri[f_data->uv_p[i].tri_index].tri[j]].uv);
1541 interp_v3_v3v3v3(uv_final, &uv[0], &uv[3], &uv[6], f_data->barycentricWeights[i * samples].v);
1543 uv_final[0] = uv_final[0] * 2.0f - 1.0f;
1544 uv_final[1] = uv_final[1] * 2.0f - 1.0f;
1566 const int tri_idx = f_data->uv_p[i].tri_index;
1568 float final_color[4];
1571 for (
int j = 3; j--;) {
1632 .mlooptri = mlooptri,
1635 .scene_color_manage = scene_color_manage,
1647 .mlooptri = mlooptri,
1649 .scene_color_manage = scene_color_manage,
1671 for (
int i = 0; i < totloop; i++) {
1685 .mlooptri = mlooptri,
1701 unsigned int data_size;
1710 data_size =
sizeof(
float);
1738 if (numOfPoints < 1) {
1749 surface->data->total_points = numOfPoints;
1796 const float *value = (
float *)
surface->data->type_data;
1797 const float val = value[i] *
surface->disp_factor;
1835 float(*fcolor)[4] =
data->fcolor;
1839 pPoint[i].
color, pPoint[i].
color[3], pPoint[i].e_color, pPoint[i].e_color[3], fcolor[i]);
1853 float(*fcolor)[4] =
data->fcolor;
1858 for (
int j = 0; j < mpoly[p_index].
totloop; j++) {
1859 const int l_index = mpoly[p_index].
loopstart + j;
1860 const int v_index = mloop[l_index].
v;
1870 mloopcol_wet[l_index].
r =
c;
1871 mloopcol_wet[l_index].
g =
c;
1872 mloopcol_wet[l_index].
b =
c;
1873 mloopcol_wet[l_index].
a = 255;
1917 const int totloop =
result->totloop;
1919 const int totpoly =
result->totpoly;
1923 "Temp paint color");
1969 data.mloopcol = mloopcol;
1970 data.mloopcol_wet = mloopcol_wet;
1986 float *weight = (
float *)sData->
type_data;
1989 if (defgrp_index != -1 && !dvert && (
surface->output_name[0] !=
'\0')) {
1995 if (defgrp_index != -1 && dvert) {
2001 if ((def_weight !=
NULL) || (weight[i] != 0.0f)) {
2003 if (def_weight ==
NULL) {
2008 def_weight->
weight = weight[i];
2093 bool no_surface_data;
2113 if (no_surface_data || current_frame !=
surface->current_frame ||
2117 surface->current_frame = current_frame;
2133 bool can_simulate = ((int)
scene->
r.
cfra == current_frame) &&
2140 else if (can_simulate) {
2178 #define JITTER_SAMPLES \
2180 0.0f, 0.0f, -0.2f, -0.4f, 0.2f, 0.4f, 0.4f, -0.2f, -0.4f, 0.3f, \
2210 const int tottri =
data->tottri;
2216 const int w =
surface->image_resolution;
2219 for (
int tx = 0; tx <
w; tx++) {
2220 const int index = tx +
w * ty;
2254 for (
int i = 0; i < tottri; i++) {
2261 const float *uv1 = mloopuv[mlooptri[i].
tri[0]].
uv;
2262 const float *uv2 = mloopuv[mlooptri[i].
tri[1]].
uv;
2263 const float *uv3 = mloopuv[mlooptri[i].
tri[2]].
uv;
2270 for (
int j = 0; j < aa_samples; j++) {
2271 uv[0] =
point[0][0] + jitter5sample[j * 2] /
w;
2272 uv[1] =
point[0][1] + jitter5sample[j * 2 + 1] / h;
2281 tPoint->
v1 = mloop[mlooptri[i].
tri[0]].
v;
2282 tPoint->
v2 = mloop[mlooptri[i].
tri[1]].
v;
2283 tPoint->
v3 = mloop[mlooptri[i].
tri[2]].
v;
2310 const int w =
surface->image_resolution;
2313 for (
int tx = 0; tx <
w; tx++) {
2314 const int index = tx +
w * ty;
2322 const int u_min = (tx > 0) ? -1 : 0;
2323 const int u_max = (tx < (
w - 1)) ? 1 : 0;
2324 const int v_min = (ty > 0) ? -1 : 0;
2325 const int v_max = (ty < (h - 1)) ? 1 : 0;
2331 for (
int ni = 0; ni < 8; ni++) {
2335 if (u >= u_min && u <= u_max && v >= v_min &&
v <= v_max) {
2337 if (u != 0 ||
v != 0) {
2338 const int ind = (tx + u) +
w * (ty +
v);
2341 if (tempPoints[ind].neighbor_pixel == -1 && tempPoints[ind].tri_index != -1) {
2343 const int i = tempPoints[ind].
tri_index;
2344 const float *uv1 = mloopuv[mlooptri[i].
tri[0]].
uv;
2345 const float *uv2 = mloopuv[mlooptri[i].
tri[1]].
uv;
2346 const float *uv3 = mloopuv[mlooptri[i].
tri[2]].
uv;
2362 for (
int j = 0; j < aa_samples; j++) {
2363 uv[0] =
point[0] + jitter5sample[j * 2] /
w;
2364 uv[1] =
point[1] + jitter5sample[j * 2 + 1] / h;
2369 tPoint->
v1 = mloop[mlooptri[i].
tri[0]].
v;
2370 tPoint->
v2 = mloop[mlooptri[i].
tri[1]].
v;
2371 tPoint->
v3 = mloop[mlooptri[i].
tri[2]].
v;
2387 #undef JITTER_SAMPLES
2392 const float point[2])
2396 float min_distance = FLT_MAX;
2398 for (
int i = 0; i < 3; i++) {
2401 mloopuv[mlooptri[tri_index].tri[(i + 0)]].uv,
2402 mloopuv[mlooptri[tri_index].tri[(i + 1) % 3]].uv);
2404 if (dist_squared < min_distance) {
2405 min_distance = dist_squared;
2409 return min_distance;
2423 const float pixel[2],
2447 const int x = px +
neighX[n_index];
2448 const int y = py +
neighY[n_index];
2450 if (x < 0 || x >=
w || y < 0 || y >= h) {
2491 .best_weight = 1.0f,
2496 pixel[0] = ((
float)(px +
neighX[n_index]) + 0.5f) / (
float)
w;
2497 pixel[1] = ((
float)(py +
neighY[n_index]) + 0.5f) / (
float)h;
2509 const float pixel[2],
2517 const unsigned int *loop_idx = mlooptri[tri_index].
tri;
2520 for (
int edge_idx = 0; edge_idx < 3; edge_idx++) {
2522 if (edge_idx == in_edge) {
2526 float uv0[2], uv1[2], uv2[2];
2528 copy_v2_v2(uv0, mloopuv[loop_idx[(edge_idx + 0)]].uv);
2529 copy_v2_v2(uv1, mloopuv[loop_idx[(edge_idx + 1) % 3]].uv);
2530 copy_v2_v2(uv2, mloopuv[loop_idx[(edge_idx + 2) % 3]].uv);
2537 if (side2 == 0.0f) {
2542 const bool correct_side = (in_edge == -1) || (sidep < 0 && side2 > 0) ||
2543 (sidep > 0 && side2 < 0);
2546 if (!correct_side && sidep != 0.0f) {
2551 const int vert0 = mloop[loop_idx[(edge_idx + 0)]].
v;
2552 const int vert1 = mloop[loop_idx[(edge_idx + 1) % 3]].
v;
2558 bool found_other =
false;
2559 int target_tri = -1;
2560 int target_edge = -1;
2562 float ouv0[2], ouv1[2];
2564 for (
int i = 0; i <
map->count && !found_other; i++) {
2565 const int lt_index =
map->indices[i];
2567 if (lt_index == tri_index) {
2571 const unsigned int *other_loop_idx = mlooptri[lt_index].
tri;
2574 for (
int j = 0; j < 3; j++) {
2575 const int overt0 = mloop[other_loop_idx[(j + 0)]].
v;
2576 const int overt1 = mloop[other_loop_idx[(j + 1) % 3]].
v;
2579 if (overt0 == vert0 && overt1 == vert1) {
2581 copy_v2_v2(ouv0, mloopuv[other_loop_idx[(j + 0)]].uv);
2582 copy_v2_v2(ouv1, mloopuv[other_loop_idx[(j + 1) % 3]].uv);
2584 else if (overt0 == vert1 && overt1 == vert0) {
2586 copy_v2_v2(ouv1, mloopuv[other_loop_idx[(j + 0)]].uv);
2587 copy_v2_v2(ouv0, mloopuv[other_loop_idx[(j + 1) % 3]].uv);
2591 target_tri = lt_index;
2608 if (depth > 0 && correct_side) {
2627 float closest_point[2], dir_vec[2], tgt_pixel[2];
2630 CLAMP(lambda, 0.0f, 1.0f);
2635 int w = bdata->
w, h = bdata->
h, px = bdata->
px, py = bdata->
py;
2637 const int final_pixel[2] = {(int)
floorf(tgt_pixel[0] *
w), (int)
floorf(tgt_pixel[1] * h)};
2640 if (final_pixel[0] < 0 || final_pixel[0] >=
w || final_pixel[1] < 0 || final_pixel[1] >= h) {
2649 int final_index = final_pixel[0] +
w * final_pixel[1];
2652 if (final_index == (px +
w * py)) {
2657 if (tempPoints[final_index].neighbor_pixel != -1) {
2661 if (final_index == (px +
w * py)) {
2666 const int final_tri_index = tempPoints[final_index].
tri_index;
2668 if (!
ELEM(final_tri_index, target_tri, -1)) {
2671 const float final_pt[2] = {((final_index %
w) + 0.5f) /
w, ((final_index /
w) + 0.5f) / h};
2687 const int idx = ed->
n_index[index];
2689 for (
int i = 0; i < ed->
n_num[index]; i++) {
2690 if (ed->
n_target[idx + i] == neighbor) {
2702 int *new_n_index =
MEM_callocN(
sizeof(
int) * active_points,
"Surface Adj Index");
2703 int *new_n_num =
MEM_callocN(
sizeof(
int) * active_points,
"Surface Adj Counts");
2705 if (new_n_num && new_n_index) {
2707 int total_targets = 0;
2709 for (
int index = 0; index < active_points; index++) {
2710 total_targets += ed->
n_num[index];
2711 new_n_num[index] = ed->
n_num[index];
2714 for (
int index = 0; index < active_points; index++) {
2719 for (
int i = 0, idx = ed->
n_index[index]; i < ed->n_num[index]; i++) {
2720 const int target = ed->
n_target[idx + i];
2725 new_n_num[target]++;
2732 int *new_n_target =
MEM_callocN(
sizeof(
int) * total_targets,
"Surface Adj Targets");
2738 for (
int index = 0; index < active_points; index++) {
2739 new_n_index[index] = n_pos;
2740 memcpy(&new_n_target[n_pos],
2742 sizeof(
int) * ed->
n_num[index]);
2745 n_pos += new_n_num[index];
2746 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];
2761 const int num = new_n_num[target]++;
2762 new_n_target[new_n_index[target] + num] = index;
2775 ed->
n_num = new_n_num;
2820 return setError(canvas,
N_(
"Canvas mesh not updated"));
2823 return setError(canvas,
N_(
"Cannot bake non-'image sequence' formats"));
2838 return setError(canvas,
N_(
"No UV data on canvas"));
2840 if (
surface->image_resolution < 16 ||
surface->image_resolution > 8192) {
2841 return setError(canvas,
N_(
"Invalid resolution"));
2844 const int w =
surface->image_resolution;
2850 CLOG_INFO(&
LOG, 1,
"Preparing UV surface of %ix%i pixels and %i tris.",
w, h, tottri);
2858 return setError(canvas,
N_(
"Not enough free memory"));
2861 tempPoints =
MEM_callocN(
w * h *
sizeof(*tempPoints),
"Temp PaintUVPoint");
2866 final_index =
MEM_callocN(
w * h *
sizeof(*final_index),
"Temp UV Final Indexes");
2871 tempWeights =
MEM_mallocN(
w * h * aa_samples *
sizeof(*tempWeights),
"Temp bWeights");
2881 faceBB =
MEM_mallocN(tottri *
sizeof(*faceBB),
"MPCanvasFaceBB");
2891 for (
int i = 0; i < tottri; i++) {
2895 for (
int j = 1; j < 3; j++) {
2906 .tempPoints = tempPoints,
2907 .tempWeights = tempWeights,
2908 .mlooptri = mlooptri,
2930 data.active_points = &active_points;
2947 for (
int i = 0; i <
w * h; i++) {
2948 if (tempPoints[i].tri_index != -1) {
2949 final_index[i] = cursor;
2962 int *vert_to_looptri_map_mem;
2965 &vert_to_looptri_map_mem,
2973 int total_border = 0;
2975 for (
int ty = 0; ty < h; ty++) {
2976 for (
int tx = 0; tx <
w; tx++) {
2977 const int index = tx +
w * ty;
2979 if (tempPoints[index].tri_index != -1) {
2980 ed->
n_index[final_index[index]] = n_pos;
2981 ed->
n_num[final_index[index]] = 0;
2983 if (tempPoints[index].neighbor_pixel != -1) {
2988 for (
int i = 0; i < 8; i++) {
2992 &
data, vert_to_looptri_map,
w, h, tx, ty, i);
2994 if (n_target >= 0 && n_target != index) {
2996 ed, final_index[index], final_index[n_target])) {
2997 ed->
n_target[n_pos] = final_index[n_target];
2998 ed->
n_num[final_index[index]]++;
3024 for (
int i = 0,
next = 0; i < active_points; i++) {
3035 FILE *dump_file = fopen(
"dynpaint-adj-data.txt",
"w");
3036 int *tmp =
MEM_callocN(
sizeof(
int) * active_points,
"tmp");
3037 for (
int ty = 0; ty < h; ty++) {
3038 for (
int tx = 0; tx <
w; tx++) {
3039 const int index = tx +
w * ty;
3040 if (tempPoints[index].tri_index != -1) {
3041 tmp[final_index[index]] = index;
3045 for (
int ty = 0; ty < h; ty++) {
3046 for (
int tx = 0; tx <
w; tx++) {
3047 const int index = tx +
w * ty;
3048 const int fidx = final_index[index];
3050 if (tempPoints[index].tri_index != -1) {
3053 "%d\t%d,%d\t%u\t%d,%d\t%d\t",
3057 tempPoints[index].tri_index,
3058 nidx < 0 ? -1 : (nidx %
w),
3059 nidx < 0 ? -1 : h - 1 - (nidx /
w),
3061 for (
int i = 0; i < ed->
n_num[fidx]; i++) {
3063 fprintf(dump_file,
"%s%d,%d", i ?
" " :
"", tgt %
w, h - 1 - tgt /
w);
3065 fprintf(dump_file,
"\n");
3110 for (
int index = 0, cursor = 0; index < (
w * h); index++) {
3111 if (tempPoints[index].tri_index != -1) {
3114 &tempWeights[index * aa_samples],
3115 sizeof(*tempWeights) * aa_samples);
3122 setError(canvas,
N_(
"Not enough free memory"));
3146 for (index = 0; index < sData->
total_points; index++) {
3150 pPoint->alpha = 1.0f;
3153 if (uvPoint->neighbor_pixel != -1) {
3154 pPoint->
color[2] = 1.0f;
3158 if (uvPoint->tri_index != -1) {
3159 pPoint->
color[0] = 1.0f;
3160 pPoint->
color[1] = (
float)(uvPoint->tri_index % 255) / 256.0f;
3171 return (
error == 0);
3210 float depth = ((
float *)
surface->data->type_data)[index];
3217 depth /=
surface->depth_clamp;
3221 depth = (0.5f - depth / 2.0f);
3224 CLAMP(depth, 0.0f, 1.0f);
3237 float depth = wPoint->
height;
3244 depth /=
surface->depth_clamp;
3247 depth = (0.5f + depth / 2.0f);
3248 CLAMP(depth, 0.0f, 1.0f);
3271 const char *filepath,
3286 #ifndef WITH_OPENEXR
3291 BLI_strncpy(output_file, filepath,
sizeof(output_file));
3311 switch (output_layer) {
3340 switch (output_layer) {
3360 switch (output_layer) {
3422 const float *t0, *t1, *t2;
3425 t0 = vert[mloop[mlooptri[index].
tri[0]].
v].
co;
3426 t1 = vert[mloop[mlooptri[index].
tri[1]].
v].
co;
3427 t2 = vert[mloop[mlooptri[index].
tri[2]].
v].
co;
3431 if (dist >= 0 && dist < hit->dist) {
3453 float nearest_tmp[3], dist_sq;
3455 const float *t0, *t1, *t2;
3456 t0 = vert[mloop[mlooptri[index].
tri[0]].
v].
co;
3457 t1 = vert[mloop[mlooptri[index].
tri[1]].
v].
co;
3458 t2 = vert[mloop[mlooptri[index].
tri[2]].
v].
co;
3463 if (dist_sq < nearest->dist_sq) {
3464 nearest->
index = index;
3467 nearest->
no[0] = 0.0f;
3485 const int paintFlags,
3486 const float paintColor[3],
3487 const float paintAlpha,
3488 const float paintWetness,
3489 const float timescale)
3509 float wetness = paintWetness;
3510 CLAMP(wetness, 0.0f, 1.0f);
3521 float a_ratio, a_highest;
3523 float invFact = 1.0f - paintAlpha;
3531 if (a_highest > invFact) {
3532 a_ratio = invFact / a_highest;
3534 pPoint->
e_color[3] *= a_ratio;
3535 pPoint->
color[3] *= a_ratio;
3539 pPoint->
e_color[3] -= paintAlpha * timescale;
3541 pPoint->
color[3] -= paintAlpha * timescale;
3545 wetness = (1.0f - paintWetness) * pPoint->
e_color[3];
3555 const float isect_change = isect_height - wPoint->
brush_isect;
3563 isect_height *= wave_factor;
3566 if (wave_factor > 0.0f && wPoint->
height > isect_height) {
3569 else if (wave_factor < 0.0f && wPoint->
height < isect_height) {
3576 wPoint->
height = isect_height;
3587 if (isect_change < 0.0f) {
3588 wPoint->
height += isect_change * wave_factor;
3608 const float timescale)
3614 influence *=
surface->influence_scale;
3615 depth *=
surface->influence_scale;
3617 strength = influence * brush->
alpha;
3618 CLAMP(strength, 0.0f, 1.0f);
3625 CLAMP(vel_factor, 0.0f, 1.0f);
3632 strength *= coba_res[3];
3635 depth *= coba_res[3];
3642 float paintWetness = brush->
wetness * strength;
3643 float paintAlpha = strength;
3646 surface, index, brush->
flags, paint, paintAlpha, paintWetness, timescale);
3650 float *value = (
float *)sData->
type_data;
3653 depth = value[index] + depth;
3661 value[index] *= (1.0f - strength);
3670 float *value = (
float *)sData->
type_data;
3673 value[index] *= (1.0f - strength);
3735 float(*prev_obmat)[4] =
data->prev_obmat;
3737 const float timescale =
data->timescale;
3758 float prev_obmat[4][4];
3759 Mesh *mesh_p, *mesh_c;
3760 MVert *mvert_p, *mvert_c;
3761 int numOfVerts_p, numOfVerts_c;
3765 float prev_sfra = cur_sfra - timescale;
3766 int prev_fra = cur_fra;
3768 if (prev_sfra < 0.0f) {
3770 prev_fra = cur_fra - 1;
3785 numOfVerts_p = mesh_p->
totvert;
3786 mvert_p = mesh_p->
mvert;
3801 numOfVerts_c = mesh_c->
totvert;
3802 mvert_c = mesh_c->
mvert;
3805 "Dynamic Paint brush velocity");
3811 if (numOfVerts_p != numOfVerts_c) {
3817 .brush_vel = *brushVel,
3821 .prev_obmat = prev_obmat,
3822 .timescale = timescale,
3837 float prev_obmat[4][4];
3838 float cur_loc[3] = {0.0f}, prev_loc[3] = {0.0f};
3842 float prev_sfra = cur_sfra - timescale;
3843 int prev_fra = cur_fra;
3845 if (prev_sfra < 0.0f) {
3847 prev_fra = cur_fra - 1;
3920 const float timescale =
data->timescale;
3921 const int c_index =
data->c_index;
3926 const float brush_radius =
data->brush_radius;
3927 const float *avg_brushNor =
data->avg_brushNor;
3928 const Vec3f *brushVelocity =
data->brushVelocity;
3933 const int samples = bData->
s_num[index];
3935 float total_sample = (
float)samples;
3936 float brushStrength = 0.0f;
3938 float velocity_val = 0.0f;
3940 float paintColor[3] = {0.0f};
3949 for (ss = 0; ss < samples; ss++) {
3950 float ray_start[3], ray_dir[3];
3951 float sample_factor = 0.0f;
3952 float sampleStrength = 0.0f;
3955 short hit_found = 0;
3958 float volume_factor = 0.0f;
3960 float proximity_factor = 0.0f;
3961 float prox_colorband[4] = {0.0f};
3974 sample_factor = 1.0f;
3987 nearest.
dist_sq = brush_radius * brush_radius;
3993 if (hit.
index != -1) {
3997 const int vtri[3] = {
4010 const float dist = hit.
dist;
4011 const int f_index = hit.
index;
4022 if (hit.
index != -1) {
4024 volume_factor = 1.0f;
4032 depth += dist * sample_factor;
4042 float proxDist = -1.0f;
4043 float hitCo[3] = {0.0f, 0.0f, 0.0f};
4047 if (inner_proximity && !hit_found) {
4055 if (nearest.
index != -1) {
4058 tri = nearest.
index;
4062 float proj_ray[3] = {0.0f};
4075 hit.
dist = brush_radius;
4080 if (hit.
index != -1) {
4081 proxDist = hit.
dist;
4091 if (proxDist >= 0.0f && proxDist <= brush_radius) {
4092 proximity_factor = proxDist / brush_radius;
4093 CLAMP(proximity_factor, 0.0f, 1.0f);
4094 if (!inner_proximity) {
4095 proximity_factor = 1.0f - proximity_factor;
4112 volume_factor = 1.0f - volume_factor;
4113 if (inner_proximity) {
4114 proximity_factor = 1.0f - proximity_factor;
4120 sampleStrength = volume_factor;
4126 proximity_factor = prox_colorband[3];
4133 sampleStrength = proximity_factor;
4136 sampleStrength *= sample_factor;
4145 float brushPointVelocity[3];
4148 const int v1 = mloop[mlooptri[hitTri].
tri[0]].
v;
4149 const int v2 = mloop[mlooptri[hitTri].
tri[1]].
v;
4150 const int v3 = mloop[mlooptri[hitTri].
tri[2]].
v;
4160 brushVelocity[
v1].
v,
4161 brushVelocity[
v2].
v,
4162 brushVelocity[v3].
v,
4186 float sampleColor[3];
4187 float alpha_factor = 1.0f;
4189 sampleColor[0] = brush->
r;
4190 sampleColor[1] = brush->
g;
4191 sampleColor[2] = brush->
b;
4196 sampleColor[0] = prox_colorband[0];
4197 sampleColor[1] = prox_colorband[1];
4198 sampleColor[2] = prox_colorband[2];
4203 paintColor[0] += sampleColor[0];
4204 paintColor[1] += sampleColor[1];
4205 paintColor[2] += sampleColor[2];
4206 sampleStrength *= alpha_factor;
4211 brushStrength += sampleStrength;
4215 if (brushStrength > 0.0f || depth > 0.0f) {
4218 brushStrength /= total_sample;
4220 CLAMP(brushStrength, 0.0f, 1.0f);
4224 paintColor[0] /= numOfHits;
4225 paintColor[1] /= numOfHits;
4226 paintColor[2] /= numOfHits;
4234 surface, index, brush, paintColor, brushStrength, depth, velocity_val, timescale);
4259 if (brush_mesh ==
NULL) {
4265 float avg_brushNor[3] = {0.0f};
4282 for (ii = 0; ii < numOfVerts; ii++) {
4298 mul_v3_fl(avg_brushNor, 1.0f / (
float)numOfVerts);
4301 avg_brushNor[2] = 1.0f;
4310 int total_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
4313 for (c_index = 0; c_index < total_cells; c_index++) {
4315 if (!grid->
s_num[c_index] ||
4326 .timescale = timescale,
4331 .mlooptri = mlooptri,
4332 .brush_radius = brush_radius,
4333 .avg_brushNor = avg_brushNor,
4334 .brushVelocity = brushVelocity,
4335 .treeData = &treeData,
4341 grid->
s_num[c_index],
4354 if (brushVelocity) {
4378 const float timescale =
data->timescale;
4379 const int c_index =
data->c_index;
4383 const float solidradius =
data->solidradius;
4385 const float range = solidradius +
smooth;
4386 const float particle_timestep = 0.04f * psys->
part->
timetweak;
4389 float disp_intersect = 0.0f;
4390 float radius = 0.0f;
4391 float strength = 0.0f;
4392 int part_index = -1;
4399 KDTreeNearest_3d nearest;
4400 float smooth_range, part_solidradius;
4405 if (nearest.dist > range) {
4412 part_solidradius = pa->
size;
4415 part_solidradius = solidradius;
4417 radius = part_solidradius +
smooth;
4418 if (nearest.dist < radius) {
4420 smooth_range =
max_ff(0.0f, (nearest.dist - part_solidradius));
4426 strength = 1.0f - smooth_range;
4427 disp_intersect = radius - nearest.dist;
4428 part_index = nearest.index;
4437 KDTreeNearest_3d *nearest;
4439 float smooth_range =
smooth * (1.0f - strength), dist;
4441 const float max_range =
smooth - strength *
smooth + solidradius;
4445 const int particles = BLI_kdtree_3d_range_search(
4449 for (
int n = 0; n < particles; n++) {
4458 const float s_range = nearest[n].dist - pa->
size;
4460 if (smooth_range < s_range) {
4465 smooth_range = s_range;
4466 dist = nearest[n].dist;
4467 part_index = nearest[n].index;
4470 if ((s_range < 0.0f) &&
4481 const float rad = radius +
smooth;
4482 if ((rad - dist) > disp_intersect) {
4483 disp_intersect = radius - dist;
4493 const float str = 1.0f - smooth_range;
4495 if (
str > strength) {
4500 if (strength > 0.001f) {
4501 float paintColor[4] = {0.0f};
4503 float velocity_val = 0.0f;
4530 disp_intersect = (1.0f -
sqrtf(disp_intersect / radius)) * radius;
4535 surface, index, brush, paintColor, strength, depth, velocity_val, timescale);
4550 int particlesAdded = 0;
4551 int invalidParticles = 0;
4559 const float range = solidradius +
smooth;
4583 if (
isnan(pa->state.co[0]) ||
isnan(pa->state.co[1]) ||
isnan(pa->state.co[2])) {
4593 BLI_kdtree_3d_insert(
tree, p, pa->state.co);
4600 if (invalidParticles) {
4605 if (particlesAdded < 1) {
4606 BLI_kdtree_3d_free(
tree);
4613 int total_cells = grid->
dim[0] * grid->
dim[1] * grid->
dim[2];
4616 BLI_kdtree_3d_balance(
tree);
4619 for (c_index = 0; c_index < total_cells; c_index++) {
4630 .solidradius = solidradius,
4631 .timescale = timescale,
4639 grid->
s_num[c_index],
4645 BLI_kdtree_3d_free(
tree);
4663 const float timescale =
data->timescale;
4665 const float brush_radius =
data->brush_radius;
4666 const Vec3f *brushVelocity =
data->brushVelocity;
4668 float *pointCoord =
data->pointCoord;
4671 float colorband[4] = {0.0f};
4680 strength = 1.0f -
distance / brush_radius;
4681 CLAMP(strength, 0.0f, 1.0f);
4687 if (strength >= 0.001f) {
4688 float paintColor[3] = {0.0f};
4690 float velocity_val = 0.0f;
4695 strength = colorband[3];
4708 velocity_val =
len_v3(velocity);
4721 paintColor[0] = colorband[0];
4722 paintColor[1] = colorband[1];
4723 paintColor[2] = colorband[2];
4726 paintColor[0] = brush->
r;
4727 paintColor[1] = brush->
g;
4728 paintColor[2] = brush->
b;
4733 const float disp_intersect = (1.0f -
sqrtf((brush_radius -
distance) / brush_radius)) *
4738 surface, index, brush, paintColor, strength, depth, velocity_val, timescale);
4772 .timescale = timescale,
4774 .brush_radius = brush_radius,
4775 .brushVelocity = &brushVel,
4776 .pointCoord = pointCoord,
4803 const int num_neighs = adj_data->
n_num[index];
4805 for (
int i = 0; i < num_neighs; i++) {
4806 const int n_index = adj_data->
n_index[index] + i;
4807 const int t_index = adj_data->
n_target[n_index];
4811 realCoord[bData->
s_pos[t_index]].
v,
4812 realCoord[bData->
s_pos[index]].
v);
4850 for (index = 0; index < sData->
total_points; index++) {
4851 int numOfNeighs = adj_data->
n_num[index];
4853 for (
int i = 0; i < numOfNeighs; i++) {
4864 const float force[3],
4871 closest_id[0] = closest_id[1] = -1;
4872 closest_d[0] = closest_d[1] = -1.0f;
4875 for (
int i = 0; i < numOfNeighs; i++) {
4877 const float dir_dot =
dot_v3v3(bNeighs[n_index].dir, force);
4879 if (dir_dot > closest_d[0] && dir_dot > 0.0f) {
4880 closest_d[0] = dir_dot;
4881 closest_id[0] = n_index;
4885 if (closest_d[0] < 0.0f) {
4890 for (
int i = 0; i < numOfNeighs; i++) {
4893 if (n_index == closest_id[0]) {
4897 const float dir_dot =
dot_v3v3(bNeighs[n_index].dir, force);
4898 const float closest_dot =
dot_v3v3(bNeighs[n_index].dir, bNeighs[closest_id[0]].dir);
4902 if (dir_dot > closest_d[1] && closest_dot < closest_d[0] && dir_dot > 0.0f) {
4903 closest_d[1] = dir_dot;
4904 closest_id[1] = n_index;
4910 if (closest_id[1] != -1) {
4911 float force_proj[3];
4913 const float neigh_diff =
acosf(
4914 dot_v3v3(bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir));
4915 float force_intersect;
4920 cross_v3_v3v3(tangent, bNeighs[closest_id[0]].dir, bNeighs[closest_id[1]].dir);
4922 force_intersect =
dot_v3v3(force, tangent);
4923 madd_v3_v3v3fl(force_proj, force, tangent, (-1.0f) * force_intersect);
4927 temp =
dot_v3v3(bNeighs[closest_id[0]].dir, force_proj);
4928 CLAMP(temp, -1.0f, 1.0f);
4929 closest_d[1] =
acosf(temp) / neigh_diff;
4930 closest_d[0] = 1.0f - closest_d[1];
4933 temp =
fabsf(force_intersect);
4934 CLAMP(temp, 0.0f, 1.0f);
4950 float max_velocity = 0.0f;
4957 for (
int index = 0; index < sData->
total_points; index++) {
4966 for (
int step = 0; step <
steps; step++) {
4967 for (
int index = 0; index < sData->
total_points; index++) {
4986 sData, index, &bData->
brush_velocity[index * 4], closest_d, closest_id);
4989 for (
int i = 0; i < 2; i++) {
4990 int n_index = closest_id[i];
4991 if (n_index != -1 && closest_d[i] > 0.0f) {
4992 float dir_dot = closest_d[i], dir_factor;
4993 float speed_scale = eff_scale * smudge_str / bNeighs[n_index].
dist;
4998 if (dir_dot <= 0.0f) {
5002 dir_factor = dir_dot * speed_scale;
5007 ePoint->
color[3] = ePoint->
color[3] * (1.0f - dir_factor) +
5008 pPoint->
color[3] * dir_factor;
5017 pPoint->
e_color[3] * dir_factor;
5018 pPoint->
wetness *= (1.0f - dir_factor);
5063 float *force =
data->force;
5066 float forc[3] = {0};
5083 surface->effector_weights->global_gravity *
surface->effector_weights->weight[0] /
5113 double average_force = 0.0f;
5114 float shrink_speed = 0.0f, spread_speed = 0.0f;
5115 float fastest_effect, avg_dist;
5133 .effectors = effectors,
5142 for (
int index = 0; index < sData->
total_points; index++) {
5143 average_force += (
double)(*force)[index * 4 + 3];
5155 spread_speed =
surface->spread_speed;
5158 shrink_speed =
surface->shrink_speed;
5161 fastest_effect =
max_fff(spread_speed, shrink_speed, average_force);
5190 const float eff_scale =
data->eff_scale;
5196 for (
int i = 0; i < numOfNeighs; i++) {
5197 const int n_idx = n_index[index] + i;
5199 const PaintPoint *pPoint_prev = &prevPoint[n_target[n_idx]];
5200 const float speed_scale = (bNeighs[n_idx].
dist < eff_scale) ? 1.0f :
5201 eff_scale / bNeighs[n_idx].dist;
5219 w_factor = 1.0f / numOfNeighs *
min_ff(pPoint_prev->
wetness, 1.0f) * speed_scale;
5220 CLAMP(w_factor, 0.0f, 1.0f);
5249 const float eff_scale =
data->eff_scale;
5255 for (
int i = 0; i < numOfNeighs; i++) {
5256 const int n_idx = n_index[index] + i;
5257 const float speed_scale = (bNeighs[n_idx].
dist < eff_scale) ? 1.0f :
5258 eff_scale / bNeighs[n_idx].dist;
5259 const PaintPoint *pPoint_prev = &prevPoint[n_target[n_idx]];
5260 float a_factor, ea_factor, w_factor;
5269 a_factor =
max_ff((1.0f - pPoint_prev->
color[3]) / numOfNeighs *
5270 (pPoint->
color[3] - pPoint_prev->
color[3]) * speed_scale,
5281 pPoint->
color[3] -= a_factor;
5283 pPoint->
e_color[3] -= ea_factor;
5306 const PaintPoint *pPoint_prev = &prevPoint[index];
5307 const float *force =
data->force;
5308 const float eff_scale =
data->eff_scale;
5318 float w_factor = pPoint_prev->
wetness - 0.025f;
5319 if (w_factor <= 0) {
5322 CLAMP(w_factor, 0.0f, 1.0f);
5324 float ppoint_wetness_diff = 0.0f;
5330 for (
int i = 0; i < 2; i++) {
5331 const int n_idx = closest_id[i];
5332 if (n_idx != -1 && closest_d[i] > 0.0f) {
5333 const float dir_dot = closest_d[i];
5336 if (dir_dot <= 0.0f) {
5340 float dir_factor, a_factor;
5341 const float speed_scale = eff_scale * force[index * 4 + 3] / bNeighs[n_idx].
dist;
5343 const unsigned int n_trgt = (
unsigned int)n_target[n_idx];
5348 const unsigned int epointlock_idx = n_trgt / 8;
5349 const uint8_t epointlock_bitmask = 1 << (n_trgt & 7);
5351 epointlock_bitmask) {
5356 const float e_wet = ePoint->
wetness;
5358 dir_factor =
min_ff(0.5f, dir_dot *
min_ff(speed_scale, 1.0f) * w_factor);
5361 ePoint->
wetness += dir_factor;
5365 a_factor = dir_factor / pPoint_prev->
wetness;
5366 CLAMP(a_factor, 0.0f, 1.0f);
5380 ppoint_wetness_diff += (ePoint->
wetness - e_wet);
5385 ~epointlock_bitmask);
5395 const unsigned int ppointlock_idx = index / 8;
5396 const uint8_t ppointlock_bitmask = 1 << (index & 7);
5398 ppointlock_bitmask) {
5402 pPoint->
wetness -= ppoint_wetness_diff;
5446 .prevPoint = prevPoint,
5447 .eff_scale = eff_scale,
5468 .prevPoint = prevPoint,
5469 .eff_scale = eff_scale,
5485 const size_t point_locks_size = (sData->
total_points / 8) + 1;
5486 uint8_t *point_locks =
MEM_callocN(
sizeof(*point_locks) * point_locks_size, __func__);
5493 .prevPoint = prevPoint,
5494 .eff_scale = eff_scale,
5496 .point_locks = point_locks,
5526 float mix_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
5527 float mix_e_color[4] = {0.0f, 0.0f, 0.0f, 0.0f};
5528 float mix_wetness = 0.0f;
5530 for (
int i = 0; i < numOfNeighs; i++) {
5531 const int n_idx = n_index[index] + i;
5532 const int target = n_target[n_idx];
5542 mix_e_color[3] += pPoint2->
e_color[3];
5544 mix_wetness += pPoint2->
wetness;
5547 const float divisor = 1.0f / numOfNeighs;
5554 pPoint->
color[3] = 0.0f;
5557 if (mix_e_color[3]) {
5558 pPoint->
e_color[3] = mix_e_color[3] * divisor;
5565 pPoint->
wetness = mix_wetness / numOfNeighs;
5599 const float wave_speed =
data->wave_speed;
5600 const float wave_scale =
data->wave_scale;
5601 const float wave_max_slope =
data->wave_max_slope;
5603 const float dt =
data->dt;
5604 const float min_dist =
data->min_dist;
5605 const float damp_factor =
data->damp_factor;
5609 float force = 0.0f, avg_dist = 0.0f, avg_height = 0.0f, avg_n_height = 0.0f;
5610 int numOfN = 0, numOfRN = 0;
5612 if (wPoint->
state > 0) {
5621 for (
int i = 0; i < numOfNeighs; i++) {
5622 const int n_idx = n_index[index] + i;
5623 float dist = bNeighs[n_idx].
dist * wave_scale;
5626 if (!dist || tPoint->
state > 0) {
5636 avg_n_height += tPoint->
height;
5640 force += (tPoint->
height - wPoint->
height) / (dist * dist);
5641 avg_height += tPoint->
height;
5643 avg_dist = (numOfN) ? avg_dist / numOfN : 0.0f;
5647 avg_n_height = (numOfRN) ? avg_n_height / numOfRN : 0.0f;
5648 wPoint->
height = (dt * wave_speed * avg_n_height + wPoint->
height * avg_dist) /
5649 (avg_dist + dt * wave_speed);
5655 force += (0.0f - wPoint->
height) *
surface->wave_spring / (avg_dist * avg_dist) / 2.0f;
5659 wPoint->
velocity += force * dt * wave_speed * wave_speed;
5666 if (wave_max_slope && avg_dist) {
5667 const float max_offset = wave_max_slope * avg_dist;
5668 const float offset = (numOfN) ? (avg_height / numOfN - wPoint->
height) : 0.0f;
5669 if (
offset > max_offset) {
5672 else if (
offset < -max_offset) {
5678 if (
data->reset_wave) {
5693 float dt, min_dist, damp_factor;
5694 const float wave_speed =
surface->wave_speed;
5695 const float wave_max_slope = (
surface->wave_smoothness >= 0.01f) ?
5696 (0.5f /
surface->wave_smoothness) :
5698 double average_dist = 0.0f;
5709 for (index = 0; index < sData->
total_points; index++) {
5712 for (
int i = 0; i < numOfNeighs; i++) {
5720 (average_dist / (
double)wave_speed / 3));
5726 min_dist = wave_speed * dt * 1.5f;
5727 damp_factor =
pow((1.0f -
surface->wave_damping), timescale *
surface->wave_timescale);
5729 for (ss = 0; ss <
steps; ss++) {
5735 .prevPoint = prevPoint,
5736 .wave_speed = wave_speed,
5737 .wave_scale = wave_scale,
5738 .wave_max_slope = wave_max_slope,
5740 .min_dist = min_dist,
5741 .damp_factor = damp_factor,
5742 .reset_wave = (ss ==
steps - 1),
5775 const float timescale =
data->timescale;
5784 float p_wetness = pPoint->
wetness;
5793 float dry_ratio = pPoint->
wetness / p_wetness;
5806 pPoint->
e_color[3] *= dry_ratio;
5812 if (pPoint->
color[3]) {
5813 for (
int i = 0; i < 3; i++) {
5814 pPoint->
color[i] = (f_color[i] * f_color[3] -
5824 else if (pPoint->
state > 0) {
5879 for (
int i = 0; i < numOfVerts; i++) {
5914 const Vec3f *canvas_verts =
data->canvas_verts;
5916 const bool do_velocity_data =
data->do_velocity_data;
5917 const bool new_bdata =
data->new_bdata;
5919 float prev_point[3] = {0.0f, 0.0f, 0.0f};
5922 if (do_velocity_data && !new_bdata) {
5930 float n1[3], n2[3], n3[3];
5935 bData->
s_pos[index] = index * bData->
s_num[index];
5938 for (
int ss = 0; ss < bData->
s_num[index]; ss++) {
5940 canvas_verts[tPoint->v1].
v,
5941 canvas_verts[tPoint->v2].
v,
5942 canvas_verts[tPoint->v3].
v,
5957 float scaled_nor[3];
5968 bData->
s_num[index] = adj_data->
n_num[index] + 1;
5969 bData->
s_pos[index] = adj_data->
n_index[index] + index;
5972 bData->
s_num[index] = 1;
5973 bData->
s_pos[index] = index;
5977 for (ss = 0; ss < bData->
s_num[index]; ss++) {
5981 int t_index = adj_data->
n_index[index] + (ss - 1);
5985 canvas_verts[adj_data->
n_target[t_index]].
v,
5995 float scaled_nor[3];
6005 if (do_velocity_data && !new_bdata && !bData->
clear) {
6018 bool new_bdata =
false;
6026 Vec3f *canvas_verts;
6037 if (do_velocity_data && bData->
velocity && (bData->
clear || !surface_moved)) {
6042 if (!surface_moved) {
6048 "Dynamic Paint transformed canvas verts");
6049 if (!canvas_verts) {
6056 "Dynamic Paint bake data");
6068 "Dynamic Paint bData s_pos");
6070 "Dynamic Paint bData s_num");
6072 "Dynamic Paint point coords");
6074 "Dynamic Paint bData prev_verts");
6100 if (do_velocity_data && !bData->
velocity) {
6102 "Dynamic Paint velocity");
6106 "Dynamic Paint prev velocity");
6117 for (index = 0; index < canvasNumOfVerts; index++) {
6118 copy_v3_v3(canvas_verts[index].
v, mvert[index].co);
6131 .canvas_verts = canvas_verts,
6132 .do_velocity_data = do_velocity_data,
6133 .new_bdata = new_bdata,
6180 .timescale = timescale,
6193 unsigned int numobjects;
6201 for (
int i = 0; i < numobjects; i++) {
6202 Object *brushObj = objects[i];
6215 "Dynamic Paint brush velocity");
6261 else if (brushObj != ob) {
6305 float *force =
NULL;
6309 "PaintSurfaceDataCopy");
6311 return setError(canvas,
N_(
"Not enough free memory"));
6316 for (s = 0; s <
steps; s++) {
6344 float timescale = 1.0f;
6357 timescale = 1.0f / (
surface->substeps + 1);
typedef float(TangentPoint)[2]
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, float m_dist, const float v0[3], const float v1[3], const float v2[3])
BVHTree * BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, const struct Mesh *mesh, BVHCacheType bvh_cache_type, int tree_type)
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)
@ LIB_ID_COPY_SET_COPIED_ON_WRITE
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(const struct Mesh *source, bool reference)
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
void BKE_mesh_tag_coords_changed(struct Mesh *mesh)
void BKE_mesh_vert_looptri_map_create(MeshElemMap **r_map, int **r_mem, const struct MVert *mvert, int totvert, const struct MLoopTri *mlooptri, int totlooptri, const struct MLoop *mloop, int totloop)
const struct MLoopTri * BKE_mesh_runtime_looptri_ensure(const 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, 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_ctime_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])
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 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
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
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, 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(int start, 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_INITIAL_NONE
@ MOD_DPAINT_INITIAL_VERTEXCOLOR
@ MOD_DPAINT_INITIAL_COLOR
@ MOD_DPAINT_INITIAL_TEXTURE
@ MOD_DPAINT_SURFACE_T_WEIGHT
@ MOD_DPAINT_SURFACE_T_PAINT
@ MOD_DPAINT_SURFACE_T_DISPLACE
@ MOD_DPAINT_SURFACE_T_WAVE
@ MOD_DPAINT_RAY_BRUSH_AVG
@ MOD_DPAINT_WAVE_OPEN_BORDERS
@ MOD_DPAINT_DISP_INCREMENTAL
@ MOD_DPAINT_DISSOLVE_LOG
@ MOD_DPAINT_PRFALL_CONSTANT
@ MOD_DPAINT_PRFALL_SMOOTH
@ MOD_DPAINT_DISP_DISPLACE
@ 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
@ MOD_DPAINT_EFFECT_DO_DRIP
@ MOD_DPAINT_EFFECT_DO_SPREAD
@ MOD_DPAINT_EFFECT_DO_SHRINK
@ MOD_DPAINT_WAVEB_REFLECT
@ MOD_DPAINT_WAVEB_CHANGE
@ MOD_DPAINT_SURFACE_F_PTEX
@ MOD_DPAINT_SURFACE_F_VERTEX
@ MOD_DPAINT_SURFACE_F_IMAGESEQ
@ MOD_DPAINT_IMGFORMAT_OPENEXR
@ MOD_DPAINT_IMGFORMAT_PNG
@ eModifierFlag_SharedCaches
@ MOD_DYNAMICPAINT_TYPE_BRUSH
@ MOD_DYNAMICPAINT_TYPE_CANVAS
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
@ PART_FLUID_SPRAYFOAMBUBBLE
#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 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 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 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)
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 Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
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)
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
void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, const char *filepath, short output_layer)
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)
static void dynamic_paint_surface_pre_step_cb(void *__restrict userdata, const int index, const TaskParallelTLS *__restrict UNUSED(tls))
struct @211::@212 surface
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
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)
ccl_device_inline float3 ceil(const float3 &a)
ccl_device_inline float3 pow(float3 v, float e)
static void error(const char *str)
static Color mix_color(Color col_src, Color col_dst, typename Traits::BlendType fac)
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T distance(const T &a, const T &b)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
SocketIndexByIdentifierMap * map
smooth(Type::FLOAT, "mask_weight")
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 float(* vert_normals)[3]
const DynamicPaintSurface * surface
const bool do_velocity_data
const Vec3f * canvas_verts
const float(* vert_normals)[3]
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 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)