177 float co[3], mat[4][4];
184 if ((psys = edit->
psys)) {
268 for (
int p = 0; p < edit->
totpoint; p++) {
271 for (
int k = 0; k <
point->totkey; k++) {
273 key->
co = hair_key->
co;
322 for (pid = pidlist.
first; pid; pid = pid->
next) {
529 memset(&
data->shape_bvh, 0,
sizeof(
data->shape_bvh));
598 if (screen_co[0] >= 0 && screen_co[0] < vd->
w && screen_co[1] >= 0 && screen_co[1] < vd->
h) {
601 depth = vd->
depths[screen_co[1] * vd->
w + screen_co[0]];
610 if (win[2] - 0.00001f > depth) {
627 dx =
data->mval[0] - screen_co[0];
628 dy =
data->mval[1] - screen_co[1];
629 dist =
sqrtf(dx * dx + dy * dy);
655 if (screen_co[0] >
data->rect->xmin && screen_co[0] <
data->rect->xmax &&
656 screen_co[1] >
data->rect->ymin && screen_co[1] <
data->rect->ymax) {
698 const float mat[4][4],
699 const float imat[4][4],
709 float mouse_distance);
722 int nearest_point, nearest_key;
723 float dist =
data->rad;
742 nearest_key =
point->totkey - 1;
774 if (nearest_point != -1) {
775 func(
data, nearest_point, nearest_key,
true);
798 if (selected == 0 || key->flag &
PEK_SELECT) {
799 float mouse_distance;
801 func(
data, p, mouse_distance);
809 if (selected == 0 || key->flag &
PEK_SELECT) {
810 float mouse_distance;
812 func(
data, p, mouse_distance);
842 const int selected = iter_data->
selected;
843 float mat[4][4], imat[4][4];
852 float mouse_distance;
859 iter_data->
func(
data, mat, imat, iter,
point->totkey - 1, key, mouse_distance);
870 float mouse_distance;
877 iter_data->
func(
data, mat, imat, iter, k, key, mouse_distance);
895 iter_data.
edit = edit;
897 iter_data.
func = func;
922 func(
data, p, k,
true);
974 KDTreeNearest_3d nearest;
977 float mat[4][4], co[3];
988 tree = BLI_kdtree_3d_new(totpart);
997 BLI_kdtree_3d_insert(
tree, p, co);
1000 BLI_kdtree_3d_balance(
tree);
1015 index = BLI_kdtree_3d_find_nearest(
tree, co, &nearest);
1018 if (index != -1 && index != p && (nearest.dist <= 0.0002f)) {
1037 BLI_kdtree_3d_free(
tree);
1047 float mat[4][4], mmat[4][4], immat[4][4];
1074 mpoint = edit->
points + mi;
1091 mkey = mpoint->
keys;
1092 for (k = 0; k < mpa->
totkey; k++, mkey++, mhkey++) {
1093 mkey->
co = mhkey->
co;
1094 mkey->time = &mhkey->
time;
1107 mkey = mpoint->
keys;
1108 for (k = 0; k < pa->
totkey; k++, hkey++, mhkey++, key++, mkey++) {
1111 mhkey->
co[0] = -mhkey->
co[0];
1204 float hairimat[4][4], hairmat[4][4];
1206 float *vec, *
nor, dvec[3],
dot, dist_1st = 0.0f;
1207 const float dist = iter_data->
dist;
1219 dist_1st *= dist * emitterdist;
1233 if (
dot < dist_1st) {
1245 dist_1st *= 1.3333f;
1277 iter_data.
psys = psys;
1278 iter_data.
edit = edit;
1279 iter_data.
dist = dist;
1328 iter_data.
edit = edit;
1352 float dv0[3] = {0.0f, 0.0f, 0.0f};
1353 float dv1[3] = {0.0f, 0.0f, 0.0f};
1354 float dv2[3] = {0.0f, 0.0f, 0.0f};
1355 for (
int j = 1; j <
point->totkey; j++) {
1360 key =
point->keys + 1;
1362 dv1[0] = dv1[1] = dv1[2] = 0.0;
1367 dv0[0] = dv0[1] = dv0[2] = 0.0;
1370 for (; k <
point->totkey; k++, key++) {
1376 if (k < point->totkey - 1) {
1401 iter_data.
edit = edit;
1402 iter_data.
pset = pset;
1420 for (k = 0; k <
point->totkey - 1; k++, key++) {
1421 key->length =
len_v3v3(key->co, (key + 1)->co);
1455 for (i = 0; i < totface; i++, vec += 6,
nor += 6) {
1532 float hairmat[4][4];
1555 float vec1[3], vec2[3], frs_sec, dfra;
1569 dfra = *(key + 1)->
time - *key->time;
1577 if (
point->totkey > 2) {
1584 else if (k ==
point->totkey - 1) {
1585 dfra = *key->time - *(key - 1)->
time;
1593 if (
point->totkey > 2) {
1601 dfra = *(key + 1)->
time - *(key - 1)->time;
1607 sub_v3_v3v3(key->vel, (key + 1)->co, (key - 1)->co);
1689 data->is_changed =
true;
1699 if (sel_op_result != -1) {
1702 data->is_changed =
true;
1735 bool changed =
false;
1791 bool changed =
false;
1808 ot->
name =
"(De)select All";
1809 ot->
idname =
"PARTICLE_OT_select_all";
1842 data->is_changed =
true;
1859 bool found =
data.is_changed;
1882 bool changed =
false;
1889 else if (found ||
params->deselect_all) {
1896 switch (
params->sel_op) {
1939 return changed || found;
1978 action =
data.select_toggle_action;
1981 data.select_action = action;
1984 if (
data.is_changed) {
1994 ot->
name =
"Select Roots";
1995 ot->
idname =
"PARTICLE_OT_select_roots";
2020 if (
point->totkey == 0) {
2051 action =
data.select_toggle_action;
2054 data.select_action = action;
2057 if (
data.is_changed) {
2069 ot->
name =
"Select Tips";
2070 ot->
idname =
"PARTICLE_OT_select_tips";
2144 if (
data.is_changed) {
2154 ot->
name =
"Select Random";
2155 ot->
idname =
"PARTICLE_OT_select_random";
2156 ot->
description =
"Select a randomly distributed set of hair or points";
2172 "Select either hair or points");
2198 ot->
name =
"Select Linked All";
2199 ot->
idname =
"PARTICLE_OT_select_linked";
2200 ot->
description =
"Select all keys linked to already selected ones";
2219 mval[0] = location[0];
2220 mval[1] = location[1];
2244 ot->
name =
"Select Linked";
2245 ot->
idname =
"PARTICLE_OT_select_linked_pick";
2246 ot->
description =
"Select nearest particle from mouse pointer";
2258 ot->
srna,
"deselect", 0,
"Deselect",
"Deselect linked keys rather than selecting them");
2270 bool changed =
false;
2312 data.sel_op = sel_op;
2325 bool is_changed =
data.is_changed;
2383 if (
data->is_changed) {
2387 return data->is_changed;
2406 float co[3], mat[4][4];
2436 const bool is_select = key->flag &
PEK_SELECT;
2441 mcoords, mcoords_len, screen_co[0], screen_co[1],
IS_CLIPPED) &&
2444 if (sel_op_result != -1) {
2447 data.is_changed =
true;
2452 if (
point->totkey) {
2456 const bool is_select = key->flag &
PEK_SELECT;
2461 mcoords, mcoords_len, screen_co[0], screen_co[1],
IS_CLIPPED) &&
2464 if (sel_op_result != -1) {
2467 data.is_changed =
true;
2530 ot->
name =
"Hide Selected";
2614 else if (k ==
point->totkey - 1) {
2620 if ((((key - 1)->flag & (key + 1)->flag) &
PEK_SELECT) == 0) {
2630 data->is_changed =
true;
2651 ot->
name =
"Select Less";
2652 ot->
idname =
"PARTICLE_OT_select_less";
2653 ot->
description =
"Deselect boundary selected keys of each particle";
2685 else if (k ==
point->totkey - 1) {
2691 if (((key - 1)->flag | (key + 1)->flag) &
PEK_SELECT) {
2702 data->is_changed =
true;
2723 ot->
name =
"Select More";
2724 ot->
idname =
"PARTICLE_OT_select_more";
2725 ot->
description =
"Select keys linked to boundary selected keys of each particle";
2749 HairKey *key, *new_keys, *okey;
2751 float dval, sta, end;
2769 end = (key +
data->totrekey - 1)->
time = (okey + pa->
totkey - 1)->time;
2770 dval = (end - sta) / (
float)(
data->totrekey - 1);
2773 for (k = 1, key++; k <
data->totrekey - 1; k++, key++) {
2784 pa->
hair = new_keys;
2793 for (k = 0, key = pa->
hair; k < pa->totkey; k++, key++, ekey++) {
2829 ot->
description =
"Change the number of keys of selected particles (root and tip keys included)";
2840 RNA_def_int(
ot->
srna,
"keys_number", 2, 2, INT_MAX,
"Number of Keys",
"", 2, 100);
2874 for (k = 1, key++; k < pa->
totkey; k++, key++) {
2884 pa->
hair = new_keys;
2888 k++, key++, ekey++) {
2909 int i, new_totpart = psys->
totpart, removed = 0;
2925 if (new_totpart != psys->
totpart) {
2929 "PTCacheEditKey array");
2931 if (
ELEM(
NULL, new_pars, new_points)) {
2990 HairKey *hkey, *nhkey, *new_hkeys = 0;
3011 new_totkey =
point->totkey;
3016 if (new_totkey < 2) {
3030 if (new_totkey != pa->
totkey) {
3036 while (key->flag &
PEK_TAG && hkey < pa->hair + pa->
totkey) {
3041 if (hkey < pa->hair + pa->
totkey) {
3047 nkey->
co = nhkey->
co;
3050 nkey->
flag = key->flag;
3051 nkey->
ftime = key->ftime;
3052 nkey->
length = key->length;
3068 pa->
hair = new_hkeys;
3069 point->keys = new_keys;
3094 HairKey *key, *nkey, *new_keys;
3098 short totnewkey = 0;
3106 for (k = 0, ekey =
point->keys; k < pa->totkey - 1; k++, ekey++) {
3112 if (totnewkey == 0) {
3119 "Hair subdivide keys");
3121 "Hair subdivide edit keys");
3126 for (k = 0, ekey =
point->keys; k < pa->totkey - 1; k++, key++, ekey++) {
3128 memcpy(nkey, key,
sizeof(
HairKey));
3131 nekey->
co = nkey->
co;
3139 state.time = (endtime != 0.0f) ? nkey->
time / endtime : 0.0f;
3143 nekey->
co = nkey->
co;
3155 memcpy(nkey, key,
sizeof(
HairKey));
3158 nekey->
co = nkey->
co;
3164 pa->
hair = new_keys;
3169 point->keys = new_ekeys;
3196 ot->
idname =
"PARTICLE_OT_subdivide";
3197 ot->
description =
"Subdivide selected particles segments (adds keys)";
3222 KDTreeNearest_3d nearest[10];
3225 int n, totn, removed, totremoved;
3246 BLI_kdtree_3d_insert(
tree, p, co);
3249 BLI_kdtree_3d_balance(
tree);
3258 totn = BLI_kdtree_3d_find_nearest_n(
tree, co, nearest, 10);
3260 for (n = 0; n < totn; n++) {
3262 if (nearest[n].index > p && nearest[n].dist <
threshold) {
3271 BLI_kdtree_3d_free(
tree);
3275 totremoved += removed;
3278 if (totremoved == 0) {
3293 ot->
name =
"Remove Doubles";
3294 ot->
idname =
"PARTICLE_OT_remove_doubles";
3295 ot->
description =
"Remove selected particles close enough of others";
3311 "Threshold distance within which particles are removed",
3338 hkey = pa->
hair + k;
3353 ot->
idname =
"PARTICLE_OT_weight_set";
3369 "Interpolation factor between current brush weight, and keys' weights",
3434 {
DEL_KEY,
"KEY", 0,
"Key",
""},
3501 "Delete a full particle or only keys");
3521 int *mirrorfaces =
NULL;
3522 int rotation, totpart, newtotpart;
3569 if (newtotpart != psys->
totpart) {
3598 const int pa_num = pa->
num;
3604 if (!(
point->flag &
PEP_TAG) || mirrorfaces[pa_num * 2] == -1) {
3619 rotation = mirrorfaces[pa_num * 2 + 1];
3620 newpa->
fuv[0] = pa->
fuv[2];
3621 newpa->
fuv[1] = pa->
fuv[1];
3622 newpa->
fuv[2] = pa->
fuv[0];
3623 newpa->
fuv[3] = pa->
fuv[3];
3624 while (rotation--) {
3625 if (mtessface[pa_num].v4) {
3636 newpa->
num = mirrorfaces[pa_num * 2];
3638 if (use_dm_final_indices) {
3647 key = newpoint->
keys;
3648 for (k = 0, hkey = newpa->
hair; k < newpa->totkey; k++, hkey++, key++) {
3650 key->time = &hkey->
time;
3707 ot->
description =
"Duplicate and mirror the selected particles along the local X axis";
3729 float mouse_distance)
3738 fac = (
float)
pow((
double)(1.0f - mouse_distance /
data->rad), (
double)
data->combfac);
3755 float rad2, cut_time = 1.0;
3756 float x0, x1, v0,
v1, o0, o1, xo0, xo1, d, dv;
3757 int k, cut, keys = (int)
pow(2.0, (
double)pset->
draw_step);
3780 x0 = (
float)screen_co[0];
3781 x1 = (
float)screen_co[1];
3784 o1 = (
float)
data->mval[1];
3796 for (k = 1, key++; k <= keys; k++, key++) {
3801 x0 = (
float)screen_co[0];
3802 x1 = (
float)screen_co[1];
3809 v0 = (
float)screen_co[0] - x0;
3810 v1 = (
float)screen_co[1] - x1;
3812 dv = v0 * v0 +
v1 *
v1;
3814 d = (v0 * xo1 -
v1 * xo0);
3816 d = dv * rad2 - d * d;
3821 cut_time = -(v0 * xo0 +
v1 * xo1 + d);
3823 if (cut_time > 0.0f) {
3826 if (cut_time < 1.0f) {
3827 cut_time += (
float)(k - 1);
3828 cut_time /= (
float)keys;
3835 x0 = (
float)screen_co[0];
3836 x1 = (
float)screen_co[1];
3844 if (cut_time < 0.0f) {
3859 float dvec[3], pvec[3] = {0.0f, 0.0f, 0.0f};
3882 float mat[4][4], imat[4][4];
3886 float co_root[3], no_root[3];
3887 float co_prev[3], co[3];
3888 float fac = 0.0f, length_accum = 0.0f;
3889 bool puff_volume =
false;
3890 bool changed =
false;
3938 fac = (
float)
pow((
double)(1.0f - mouse_distance /
data->rad), (
double)
data->pufffac);
4004 float oco[3], onor[3];
4045 float UNUSED(imat[4][4]),
4049 float UNUSED(mouse_distance))
4065 float UNUSED(imat[4][4]),
4069 float UNUSED(mouse_distance))
4087 float UNUSED(mouse_distance))
4108 const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3],
float w[4])
4110 float co[3], vert[4][3];
4117 co[0] =
v1[0] *
w[0] +
v2[0] *
w[1] + v3[0] *
w[2] + v4[0] *
w[3];
4118 co[1] =
v1[1] *
w[0] +
v2[1] *
w[1] + v3[1] *
w[2] + v4[1] *
w[3];
4119 co[2] =
v1[2] *
w[0] +
v2[2] *
w[1] + v3[2] *
w[2] + v4[2] *
w[3];
4143 float cur_d, cur_uv[2],
v1[3],
v2[3], v3[3], v4[3],
min[3],
max[3], p_min[3], p_max[3];
4144 float cur_ipoint[3];
4167 if (pa_minmax == 0) {
4182 for (i = 0; i < totface; i++, mface++) {
4200 if (face_minmax == 0) {
4220 if (radius > 0.0f) {
4222 if (cur_d < *min_d) {
4231 if (cur_d < *min_d) {
4242 if (cur_d < *min_d) {
4244 min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
4245 min_w[1] = cur_uv[0];
4246 min_w[2] = cur_uv[1];
4257 if (cur_d < *min_d) {
4259 min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
4261 min_w[2] = cur_uv[0];
4262 min_w[3] = cur_uv[1];
4303 const int number = iter_data->
number;
4304 const short size = iter_data->
size;
4315 while (dmx * dmx + dmy * dmy > size2) {
4326 mco[0] =
data->mval[0] + dmx;
4327 mco[1] =
data->mval[1] + dmy;
4329 float co1[3], co2[3];
4376 void *__restrict join_v,
4377 void *__restrict chunk_v)
4385 void *__restrict chunk_v)
4405 int i, k, n = 0, totpart = psys->
totpart;
4406 float co1[3], imat[4][4];
4407 float framestep, timestep;
4425 sim.
psmd = psmd_eval;
4448 iter_data.
number = number;
4467 for (
int current_iter = 0, new_index = 0; current_iter < number; current_iter++) {
4471 if (new_index != current_iter) {
4475 memcpy(add_pars + new_index, add_pars + current_iter,
sizeof(
ParticleData));
4481 int newtotpart = totpart + n;
4482 float hairmat[4][4], cur_co[3];
4483 KDTree_3d *
tree = 0;
4487 "PTCacheEditPoint array new");
4504 edit->
points = new_points;
4512 for (i = 0, pa = psys->
particles; i < totpart; i++, pa++) {
4524 BLI_kdtree_3d_insert(
tree, i, cur_co);
4527 BLI_kdtree_3d_balance(
tree);
4536 for (i = totpart; i < newtotpart; i++, pa++,
point++) {
4537 memcpy(pa, add_pars + i - totpart,
sizeof(
ParticleData));
4540 "PTCacheEditKey add");
4543 for (k = 0, hkey = pa->
hair; k < pa->totkey; k++, hkey++, key++) {
4566 KDTreeNearest_3d ptn[3];
4568 float maxd, totw = 0.0, weight[3];
4581 maxw = BLI_kdtree_3d_find_nearest_n(
tree, co1, ptn, 3);
4583 maxd = ptn[maxw - 1].dist;
4585 for (
w = 0;
w < maxw;
w++) {
4586 weight[
w] = (
float)
pow(2.0, (
double)(-6.0f * ptn[
w].dist / maxd));
4589 for (;
w < 3;
w++) {
4594 for (
w = 0;
w < maxw;
w++) {
4599 for (
w = 0;
w < maxw;
w++) {
4600 weight[
w] = 1.0f / maxw;
4608 thkey->
time = pa->
time + k * framestep;
4610 key3[0].
time = thkey->
time / 100.0f;
4641 for (k = 0, hkey = pa->
hair; k < pset->totaddkey; k++, hkey++) {
4643 hkey->
time += k * framestep;
4647 for (k = 0, hkey = pa->
hair; k < pset->totaddkey; k++, hkey++) {
4655 BLI_kdtree_3d_free(
tree);
4731 float vec[3], mousef[2];
4733 int flip, mouse[2], removed = 0, added = 0, selected = 0, tot_steps = 1, step = 1;
4742 mouse[0] = mousef[0];
4743 mouse[1] = mousef[1];
4764 (dx != 0 || dy != 0)) ||
4775 dx /= (
float)tot_steps;
4776 dy /= (
float)tot_steps;
4778 for (step = 1; step <= tot_steps; step++) {
4779 mval[0] = bedit->
lastmouse[0] + step * dx;
4780 mval[1] = bedit->
lastmouse[1] + step * dy;
4784 const float xy_delta[2] = {dx, dy};
4789 if (
data.combfac < 0.0f) {
4790 data.combfac = 1.0f - 9.0f *
data.combfac;
4793 data.combfac = 1.0f -
data.combfac;
4834 if (brush->
invert ^ flip) {
4835 data.growfac = 1.0f -
data.growfac;
4838 data.growfac = 1.0f +
data.growfac;
4853 data.select = selected;
4856 if (
data.pufffac < 0.0f) {
4857 data.pufffac = 1.0f - 9.0f *
data.pufffac;
4860 data.pufffac = 1.0f -
data.pufffac;
4952 pset->
flag |= lock_root;
5011 switch (event->
type) {
5042 ot->
idname =
"PARTICLE_OT_brush_edit";
5043 ot->
description =
"Apply a stroke of brush to the particles";
5093 data->bvhdata.raycast_callback(&
data->bvhdata, index, ray, hit);
5095 if (hit->
index != -1) {
5104 const float dir[3] = {1.0f, 0.0f, 0.0f};
5117 return (userdata.
num_hits % 2) == 1;
5128 float cut_time = 1.0;
5145 for (k = 0; k < totkeys; k++, key++) {
5148 float co_curr_shape[3], co_next_shape[3];
5155 sub_v3_v3v3(dir_shape, co_next_shape, co_curr_shape);
5158 memset(&hit, 0,
sizeof(hit));
5160 hit.
dist = len_shape;
5166 data->shape_bvh.raycast_callback,
5168 if (hit.
index >= 0) {
5169 if (hit.
dist < len_shape) {
5170 cut_time = ((hit.
dist / len_shape) + (
float)k) / (
float)totkeys;
5179 if (cut_time < 0.0f) {
5251 pset->
flag |= lock_root;
5260 ot->
idname =
"PARTICLE_OT_shape_cut";
5261 ot->
description =
"Cut hair to conform to the set shape object";
5296 if (!(psys && psmd && psmd_eval->
mesh_final) && !cache) {
5308 edit = (psys) ? psys->
edit : cache->
edit;
5323 if (psys && !cache) {
5376 if (!
point->totkey) {
5398 if (psys && !cache) {
5423 if (psys->edit !=
NULL) {
5425 psys->free_edit(psys->edit);
5426 psys->free_edit =
NULL;
5452 if (edit && edit->
psys) {
5498 const bool is_mode_set = (ob->
mode & mode_flag) != 0;
5524 ot->
name =
"Particle Edit Toggle";
5525 ot->
idname =
"PARTICLE_OT_particle_edit_toggle";
5578 ot->
name =
"Clear Edited";
5579 ot->
idname =
"PARTICLE_OT_edited_clear";
5580 ot->
description =
"Undo all edition performed on the particle system";
5610 int num_selected = 0;
5611 float total_length = 0;
5617 if (num_selected == 0) {
5620 return total_length / num_selected;
5625 float orig_prev_co[3], prev_co[3];
5651 if (point_length != 0.0f) {
5652 const float factor =
length / point_length;
5675 if (average_length == 0.0f) {
5695 ot->
name =
"Unify Length";
5696 ot->
idname =
"PARTICLE_OT_unify_length";
typedef float(TangentPoint)[2]
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
BVHTree * BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, const struct Mesh *mesh, BVHCacheType bvh_cache_type, int tree_type)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct wmMsgBus * CTX_wm_message_bus(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
const CustomData_MeshMasks CD_MASK_BAREMESH
const float(* BKE_mesh_vertex_normals_ensure(const struct Mesh *mesh))[3]
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
struct Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct ModifierData * BKE_modifier_get_evaluated(struct Depsgraph *depsgraph, struct Object *object, struct ModifierData *md)
struct ModifierData * BKE_modifiers_findby_type(const struct Object *ob, ModifierType type)
struct ModifierData * BKE_modifiers_findby_name(const struct Object *ob, const char *name)
General operations, lookup, etc. for blender objects.
struct Mesh * BKE_object_get_evaluated_mesh(const struct Object *object)
void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3], bool use_hidden)
void psys_get_particle_on_path(struct ParticleSimulationData *sim, int pa_num, struct ParticleKey *state, bool vel)
struct ParticleSystem * psys_eval_get(struct Depsgraph *depsgraph, struct Object *object, struct ParticleSystem *psys)
void psys_mat_hair_to_orco(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
void psys_disable_all(struct Object *ob)
void psys_mat_hair_to_global(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra)
void psys_cache_edit_paths(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, bool use_render_params)
void psys_reset(struct ParticleSystem *psys, int mode)
void psys_mat_hair_to_object(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
float psys_get_timestep(struct ParticleSimulationData *sim)
void psys_particle_on_dm(struct Mesh *mesh_final, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3])
void psys_enable_all(struct Object *ob)
struct ParticleSystem * psys_get_current(struct Object *ob)
void init_particle(struct ParticleSimulationData *sim, struct ParticleData *pa)
struct ParticleSystemModifierData * psys_get_modifier(struct Object *ob, struct ParticleSystem *psys)
void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
int psys_particle_dm_face_lookup(struct Mesh *mesh_final, struct Mesh *mesh_original, int findex_orig, const float fw[4], struct LinkNode **poly_nodes)
void BKE_particle_batch_cache_dirty_tag(struct ParticleSystem *psys, int mode)
#define PSYS_RESET_DEPSGRAPH
void psys_copy_particles(struct ParticleSystem *psys_dst, struct ParticleSystem *psys_src)
void BKE_ptcache_mem_pointers_incr(void *cur[BPHYS_TOT_DATA])
void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob, struct Scene *scene, int duplis)
#define PTCACHE_VEL_PER_SEC
#define PTCACHE_TYPE_CLOTH
int BKE_ptcache_mem_pointers_seek(int point_index, struct PTCacheMem *pm, void *cur[BPHYS_TOT_DATA])
#define PTCACHE_TYPE_PARTICLES
#define PTCACHE_TYPE_SOFTBODY
@ PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain)
#define BLI_assert_unreachable()
#define BVH_RAYCAST_DIST_MAX
void BLI_bvhtree_ray_cast_all(BVHTree *tree, const float co[3], const float dir[3], float radius, float hit_dist, BVHTree_RayCastCallback callback, void *userdata)
int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
A KD-tree for nearest neighbor search.
bool BLI_lasso_is_point_inside(const int mcoords[][2], unsigned int mcoords_len, int sx, int sy, int error_value)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
MINLINE float max_ff(float a, float b)
MINLINE float interpf(float a, float b, float t)
bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3])
bool isect_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], float radius, const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3])
bool isect_line_segment_tri_v3(const float p1[3], const float p2[3], const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float r_uv[2])
void interp_weights_poly_v3(float w[], float v[][3], int n, const float co[3])
void unit_m4(float m[4][4])
void mul_mat3_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float R[4][4], const float A[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
MINLINE void copy_v2fl_v2i(float r[2], const int a[2])
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 float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], float dist)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new(unsigned int seed)
struct RNG * BLI_rng_new_srandom(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
bool BLI_rcti_is_empty(const struct rcti *rect)
void BLI_task_parallel_range(int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings)
int BLI_task_parallel_thread_id(const TaskParallelTLS *tls)
BLI_INLINE void BLI_parallel_range_settings_defaults(TaskParallelSettings *settings)
#define SHIFT4(type, a, b, c, d)
#define INIT_MINMAX(min, max)
#define DO_MINMAX(vec, min, max)
#define POINTER_AS_UINT(i)
#define SHIFT3(type, a, b, c)
#define SET_FLAG_FROM_TEST(value, test, flag)
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ ID_RECALC_COPY_ON_WRITE
#define ID_IS_LINKED(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define PSYS_HAIR_DYNAMICS
#define PSYS_HAIR_UPDATED
#define BPHYS_DATA_LOCATION
#define BPHYS_DATA_VELOCITY
#define BPHYS_DATA_ROTATION
#define PE_BRUSH_DATA_PUFF_VOLUME
#define PE_DEFLECT_EMITTER
#define PE_INTERPOLATE_ADDED
#define OBACT(_view_layer)
#define PE_TYPE_PARTICLES
int * mesh_get_x_mirror_faces(struct Object *ob, struct BMEditMesh *em, struct Mesh *me_eval)
bool ED_object_mode_compat_set(struct bContext *C, struct Object *ob, eObjectMode mode, struct ReportList *reports)
int ED_select_op_action_deselected(eSelectOp sel_op, bool is_select, bool is_inside)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
bool ED_view3d_win_to_segment_clipped(const struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes)
#define XRAY_ENABLED(v3d)
@ V3D_PROJ_TEST_CLIP_NEAR
void ED_view3d_project_v3(const struct ARegion *region, const float world[3], float r_region_co[3])
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
void ED_view3d_depths_free(ViewDepths *depths)
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3])
void view3d_operator_needs_opengl(const struct bContext *C)
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, struct ViewDepths **r_depths)
float ED_view3d_select_dist_px(void)
_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
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_smooth(bool enable)
Read Guarded memory(de)allocation.
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
Utility defines for timing/benchmarks.
#define RNA_BEGIN(sptr, itemptr, propname)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
__forceinline BoundBox intersect(const BoundBox &a, const BoundBox &b)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static void mul(btAlignedObjectArray< T > &items, const Q &value)
static unsigned long seed
const Depsgraph * depsgraph
SyclQueue void void size_t num_bytes void
static bool is_inside(int x, int y, int cols, int rows)
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 pow(float3 v, float e)
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value)
Allocate a new IDProperty of type IDP_INT, set its name and value.
static void area(int d1, int d2, int e1, int e2, float weights[2])
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T length(const vec_base< T, Size > &a)
T distance(const T &a, const T &b)
static void rekey_particle_to_time(const bContext *C, Scene *scene, Object *ob, int pa_index, float path_time)
static void free_all_psys_edit(Object *object)
static void PE_set_data(bContext *C, PEData *data)
static int hide_exec(bContext *C, wmOperator *op)
static void PE_mirror_x(Depsgraph *depsgraph, Scene *scene, Object *ob, int tagged)
static void brush_edit_exit(wmOperator *op)
static const EnumPropertyItem select_random_type_items[]
static int shape_cut_exec(bContext *C, wmOperator *UNUSED(op))
static int brush_edit_init(bContext *C, wmOperator *op)
struct BrushAddCountIterData BrushAddCountIterData
static bool key_inside_rect(PEData *data, const float co[3])
static int select_random_exec(bContext *C, wmOperator *op)
bool ED_object_particle_edit_mode_supported(const Object *ob)
bool PE_hair_poll(bContext *C)
static int pe_x_mirror(Object *ob)
void PARTICLE_OT_select_roots(wmOperatorType *ot)
static void select_keys(PEData *data, int point_index, int UNUSED(key_index), bool UNUSED(is_inside))
bool PE_poll(bContext *C)
int PE_minmax(Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, float min[3], float max[3])
bool PE_deselect_all_visible_ex(PTCacheEdit *edit)
static bool key_inside_circle(const PEData *data, float rad, const float co[3], float *distance)
static bool key_test_depth(const PEData *data, const float co[3], const int screen_co[2])
static void scale_point_to_length(PTCacheEditPoint *point, float length)
static void set_delete_particle_key(PEData *data, int pa_index, int key_index, bool UNUSED(is_inside))
PTCacheEdit * PE_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
void recalc_emitter_field(Depsgraph *UNUSED(depsgraph), Object *UNUSED(ob), ParticleSystem *psys)
static int brush_add(const bContext *C, PEData *data, short number)
static bool pe_nearest_point_and_key(bContext *C, const int mval[2], PTCacheEditPoint **r_point, PTCacheEditKey **r_key)
void PARTICLE_OT_unify_length(struct wmOperatorType *ot)
void PARTICLE_OT_weight_set(wmOperatorType *ot)
void PARTICLE_OT_remove_doubles(wmOperatorType *ot)
static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit)
struct KeyIterData KeyIterData
static void set_delete_particle(PEData *data, int pa_index)
void PARTICLE_OT_shape_cut(wmOperatorType *ot)
static void brush_add_count_iter_reduce(const void *__restrict UNUSED(userdata), void *__restrict join_v, void *__restrict chunk_v)
static int remove_doubles_exec(bContext *C, wmOperator *op)
void ED_object_particle_edit_mode_exit_ex(Scene *scene, Object *ob)
static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void PE_current_changed(Depsgraph *depsgraph, Scene *scene, Object *ob)
static void brush_smooth_do(PEData *data, float UNUSED(mat[4][4]), float imat[4][4], int point_index, int key_index, PTCacheEditKey *key, float UNUSED(mouse_distance))
static void foreach_mouse_hit_point(PEData *data, ForHitPointFunc func, int selected)
struct PointInsideBVH PointInsideBVH
static void PE_apply_lengths(Scene *scene, PTCacheEdit *edit)
static void PE_set_view3d_data(bContext *C, PEData *data)
static float calculate_point_length(PTCacheEditPoint *point)
static void foreach_selected_key(PEData *data, ForKeyFunc func)
void PARTICLE_OT_delete(wmOperatorType *ot)
static int particle_edit_toggle_exec(bContext *C, wmOperator *op)
static void point_inside_bvh_cb(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit)
static bool shape_cut_test_point(PEData *data, ParticleEditSettings *pset, ParticleCacheKey *key)
static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
static void select_tip(PEData *data, int point_index)
void PARTICLE_OT_select_less(wmOperatorType *ot)
static void pe_select_cache_free_generic_userdata(void *data)
void PE_update_object(Depsgraph *depsgraph, Scene *scene, Object *ob, int useflag)
void(* ForHitPointFunc)(PEData *data, int point_index, float mouse_distance)
static void PE_create_random_generator(PEData *data)
void PARTICLE_OT_edited_clear(wmOperatorType *ot)
static bool shape_cut_poll(bContext *C)
static void select_more_keys(PEData *data, int point_index)
void PARTICLE_OT_mirror(wmOperatorType *ot)
static bool point_is_selected(PTCacheEditPoint *point)
static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
static float pe_brush_size_get(const Scene *UNUSED(scene), ParticleBrushData *brush)
static void BKE_brush_weight_get(PEData *data, float UNUSED(mat[4][4]), float UNUSED(imat[4][4]), int point_index, int key_index, PTCacheEditKey *UNUSED(key), float UNUSED(mouse_distance))
void ED_object_particle_edit_mode_enter(bContext *C)
static void pe_update_hair_particle_edit_pointers(PTCacheEdit *edit)
static int brush_edit_exec(bContext *C, wmOperator *op)
static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, const enum eParticleSelectFlag flag)
static int subdivide_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_select_random(wmOperatorType *ot)
bool PE_poll_view3d(bContext *C)
static void iterate_lengths_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
static float calculate_average_length(PTCacheEdit *edit)
static void update_velocities(PTCacheEdit *edit)
void PARTICLE_OT_select_linked(wmOperatorType *ot)
void PARTICLE_OT_reveal(wmOperatorType *ot)
static bool key_inside_test(PEData *data, const float co[3])
void PE_free_ptcache_edit(PTCacheEdit *edit)
static void foreach_point(PEData *data, ForPointFunc func)
static bool mirror_poll(bContext *C)
bool PE_mouse_particles(bContext *C, const int mval[2], const struct SelectPick_Params *params)
void PARTICLE_OT_subdivide(wmOperatorType *ot)
static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
static void PE_data_free(PEData *data)
static void brush_comb(PEData *data, float UNUSED(mat[4][4]), float imat[4][4], int point_index, int key_index, PTCacheEditKey *key, float mouse_distance)
void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra)
void PE_create_particle_edit(Depsgraph *depsgraph, Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys)
static void nearest_key_fn(PEData *data, int point_index, int key_index, bool UNUSED(is_inside))
static void pe_select_cache_init_with_generic_userdata(bContext *C, wmGenericUserData *wm_userdata)
struct BrushEdit BrushEdit
static void brush_puff(PEData *data, int point_index, float mouse_distance)
static bool PE_create_shape_tree(PEData *data, Object *shapeob)
void update_world_cos(Object *ob, PTCacheEdit *edit)
static int select_linked_pick_exec(bContext *C, wmOperator *op)
static void brush_smooth_get(PEData *data, float mat[4][4], float UNUSED(imat[4][4]), int UNUSED(point_index), int key_index, PTCacheEditKey *key, float UNUSED(mouse_distance))
static PTCacheEdit * pe_get_current(Depsgraph *depsgraph, Scene *scene, Object *ob, bool create)
void PARTICLE_OT_select_more(wmOperatorType *ot)
static int reveal_exec(bContext *C, wmOperator *op)
static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
void PARTICLE_OT_rekey(wmOperatorType *ot)
static int rekey_exec(bContext *C, wmOperator *op)
static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata))
static int particle_intersect_mesh(Depsgraph *depsgraph, Scene *UNUSED(scene), Object *ob, Mesh *mesh, float *vert_cos, const float co1[3], const float co2[3], float *min_d, int *min_face, float *min_w, float *face_minmax, float *pa_minmax, float radius, float *ipoint)
static void rekey_particle(PEData *data, int pa_index)
static void foreach_mouse_hit_key_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
static void PE_free_shape_tree(PEData *data)
static int count_selected_keys(Scene *scene, PTCacheEdit *edit)
static const EnumPropertyItem delete_type_items[]
static int brush_edit_modal(bContext *C, wmOperator *op, const wmEvent *event)
static void subdivide_particle(PEData *data, int pa_index)
void PARTICLE_OT_select_all(wmOperatorType *ot)
void recalc_lengths(PTCacheEdit *edit)
static int select_roots_exec(bContext *C, wmOperator *op)
struct IterateLengthsIterData IterateLengthsIterData
ParticleEditSettings * PE_settings(Scene *scene)
void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot)
static void deflect_emitter_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
static void brush_add_count_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict tls_v)
static void select_key(PEData *data, int point_index, int key_index, bool UNUSED(is_inside))
void PARTICLE_OT_select_tips(wmOperatorType *ot)
static void select_less_keys(PEData *data, int point_index)
static bool brush_edit_poll(bContext *C)
static int unify_length_exec(bContext *C, wmOperator *UNUSED(op))
void ED_object_particle_edit_mode_exit(bContext *C)
static int clear_edited_exec(bContext *C, wmOperator *UNUSED(op))
void(* ForKeyFunc)(PEData *data, int point_index, int key_index, bool is_inside)
int PE_lasso_select(bContext *C, const int mcoords[][2], const int mcoords_len, const int sel_op)
static int brush_edit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void PE_apply_mirror(Object *ob, ParticleSystem *psys)
static void toggle_particle_cursor(Scene *scene, bool enable)
static bool select_action_apply(PTCacheEditPoint *point, PTCacheEditKey *key, int action)
struct DeflectEmitterIter DeflectEmitterIter
static void shape_cut(PEData *data, int pa_index)
int PE_start_edit(PTCacheEdit *edit)
static int delete_exec(bContext *C, wmOperator *op)
bool PE_circle_select(bContext *C, wmGenericUserData *wm_userdata, const int sel_op, const int mval[2], float rad)
static void brush_length(PEData *data, int point_index, float UNUSED(mouse_distance))
static int weight_set_exec(bContext *C, wmOperator *op)
PTCacheEdit * PE_get_current_from_psys(ParticleSystem *psys)
static void scale_points_to_length(PTCacheEdit *edit, float length)
static void brush_edit_apply_event(bContext *C, wmOperator *op, const wmEvent *event)
struct ApplyLengthsIterData ApplyLengthsIterData
static void select_root(PEData *data, int point_index)
static void foreach_mouse_hit_key(PEData *data, ForHitKeyMatFunc func, int selected)
PTCacheEdit * PE_create_current(Depsgraph *depsgraph, Scene *scene, Object *ob)
static void scale_point_factor(PTCacheEditPoint *point, float factor)
static void brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
void ED_object_particle_edit_mode_enter_ex(Depsgraph *depsgraph, Scene *scene, Object *ob)
static bool particle_edit_toggle_poll(bContext *C)
static void brush_cut(PEData *data, int pa_index)
bool PE_box_select(bContext *C, const rcti *rect, const int sel_op)
static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
static void remove_tagged_keys(Depsgraph *depsgraph, Object *ob, ParticleSystem *psys)
bool PE_deselect_all_visible(bContext *C)
static void PE_mirror_particle(Object *ob, Mesh *mesh, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa)
static int pe_select_all_exec(bContext *C, wmOperator *op)
void(* ForKeyMatFunc)(PEData *data, const float mat[4][4], const float imat[4][4], int point_index, int key_index, PTCacheEditKey *key)
void(* ForHitKeyMatFunc)(PEData *data, float mat[4][4], float imat[4][4], int point_index, int key_index, PTCacheEditKey *key, float mouse_distance)
static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror)
void PARTICLE_OT_hide(wmOperatorType *ot)
void PARTICLE_OT_select_linked_pick(wmOperatorType *ot)
static void select_key_op(PEData *data, int point_index, int key_index, bool is_inside)
static void brush_add_count_iter_free(const void *__restrict UNUSED(userdata_v), void *__restrict chunk_v)
void(* ForPointFunc)(PEData *data, int point_index)
static void apply_lengths_iter(void *__restrict iter_data_v, const int iter, const TaskParallelTLS *__restrict UNUSED(tls))
static void PE_free_random_generator(PEData *data)
static int select_tips_exec(bContext *C, wmOperator *op)
static void intersect_dm_quad_weights(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float w[4])
static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
static void foreach_selected_point(PEData *data, ForPointFunc func)
void PARTICLE_OT_brush_edit(wmOperatorType *ot)
static int mirror_exec(bContext *C, wmOperator *UNUSED(op))
struct BrushAddCountIterTLSData BrushAddCountIterTLSData
static void PE_update_selection(Depsgraph *depsgraph, Scene *scene, Object *ob, int useflag)
#define LOOP_UNSELECTED_POINTS
#define LOOP_SELECTED_POINTS
#define LOOP_SELECTED_KEYS
#define LOOP_TAGGED_POINTS
#define LOOP_EDITED_POINTS
#define LOOP_VISIBLE_KEYS
#define LOOP_VISIBLE_POINTS
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
ParticleEditSettings * pset
BVHTreeFromMesh shape_bvh
struct PTCacheEditKey * keys
struct ParticleSystemModifierData * psmd
struct ParticleCacheKey ** pathcache
PTCacheEditPoint * points
struct ParticleSystem * psys
struct ParticleSystemModifierData * psmd_eval
struct KDTree_3d * emitter_field
struct ParticleSystem * psys_eval
struct PointCache * cache
ParticleBrushData brush[7]
struct Object * shape_object
struct Depsgraph * depsgraph
struct ParticleSystemModifierData * psmd
struct ParticleSystem * psys
struct Mesh * mesh_original
struct PTCacheEdit * edit
struct PointCache * pointcache
void(* free_edit)(struct PTCacheEdit *edit)
struct ListBase mem_cache
struct PTCacheEdit * edit
void(* free_edit)(struct PTCacheEdit *edit)
struct ToolSettings * toolsettings
TaskParallelReduceFunc func_reduce
TaskParallelFreeFunc func_free
size_t userdata_chunk_size
wmGenericUserDataFreeFn free_fn
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
long int PIL_check_seconds_timer_i(void)
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void WM_operator_properties_select_action(wmOperatorType *ot, int default_action, bool hide_gui)
void WM_operator_properties_select_random(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
bool WM_paint_cursor_end(wmPaintCursor *handle)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
wmPaintCursor * WM_paint_cursor_activate(short space_type, short region_type, bool(*poll)(bContext *C), wmPaintCursorDraw draw, void *customdata)