192 float co[3], mat[4][4];
199 if ((psys = edit->
psys)) {
283 for (
int p = 0; p < edit->
totpoint; p++) {
286 for (
int k = 0; k < point->
totkey; k++) {
288 key->
co = hair_key->
co;
337 for (pid = pidlist.
first; pid; pid = pid->
next) {
350 if (create && !psys->
edit) {
543 memset(&
data->shape_bvh, 0,
sizeof(
data->shape_bvh));
602 if (screen_co[0] >= 0 && screen_co[0] < vd->
w && screen_co[1] >= 0 && screen_co[1] < vd->
h) {
605 depth = vd->
depths[screen_co[1] * vd->
w + screen_co[0]];
614 if (win[2] - 0.00001f > depth) {
631 dx =
data->mval[0] - screen_co[0];
632 dy =
data->mval[1] - screen_co[1];
633 dist =
sqrtf(dx * dx + dy * dy);
659 if (screen_co[0] >
data->rect->xmin && screen_co[0] <
data->rect->xmax &&
660 screen_co[1] >
data->rect->ymin && screen_co[1] <
data->rect->ymax) {
702 const float mat[4][4],
703 const float imat[4][4],
713 float mouse_distance);
726 int nearest_point, nearest_key;
727 float dist =
data->rad;
741 key = point->keys + point->totkey - 1;
746 nearest_key = point->totkey - 1;
778 if (nearest_point != -1) {
779 func(
data, nearest_point, nearest_key,
true);
800 key = point->keys + point->totkey - 1;
802 if (selected == 0 || key->flag &
PEK_SELECT) {
803 float mouse_distance;
805 func(
data, p, mouse_distance);
813 if (selected == 0 || key->flag &
PEK_SELECT) {
814 float mouse_distance;
816 func(
data, p, mouse_distance);
846 const int selected = iter_data->
selected;
847 float mat[4][4], imat[4][4];
856 float mouse_distance;
863 iter_data->
func(
data, mat, imat, iter, point->
totkey - 1, key, mouse_distance);
874 float mouse_distance;
881 iter_data->
func(
data, mat, imat, iter, k, key, mouse_distance);
899 iter_data.
edit = edit;
901 iter_data.
func = func;
926 func(
data, p, k,
true);
956 key = point->keys + point->totkey - 1;
978 KDTreeNearest_3d nearest;
981 float mat[4][4], co[3];
992 tree = BLI_kdtree_3d_new(totpart);
1001 BLI_kdtree_3d_insert(
tree, p, co);
1004 BLI_kdtree_3d_balance(
tree);
1019 index = BLI_kdtree_3d_find_nearest(
tree, co, &nearest);
1022 if (index != -1 && index != p && (nearest.dist <= 0.0002f)) {
1041 BLI_kdtree_3d_free(
tree);
1051 float mat[4][4], mmat[4][4], immat[4][4];
1077 point = edit->
points + i;
1078 mpoint = edit->
points + mi;
1095 mkey = mpoint->
keys;
1096 for (k = 0; k < mpa->
totkey; k++, mkey++, mhkey++) {
1097 mkey->
co = mhkey->
co;
1098 mkey->time = &mhkey->
time;
1111 mkey = mpoint->
keys;
1112 for (k = 0; k < pa->
totkey; k++, hkey++, mhkey++, key++, mkey++) {
1115 mhkey->
co[0] = -mhkey->
co[0];
1208 float hairimat[4][4], hairmat[4][4];
1210 float *vec, *
nor, dvec[3],
dot, dist_1st = 0.0f;
1211 const float dist = iter_data->
dist;
1223 dist_1st *= dist * emitterdist;
1237 if (
dot < dist_1st) {
1249 dist_1st *= 1.3333f;
1281 iter_data.
psys = psys;
1282 iter_data.
edit = edit;
1283 iter_data.
dist = dist;
1332 iter_data.
edit = edit;
1356 float dv0[3] = {0.0f, 0.0f, 0.0f};
1357 float dv1[3] = {0.0f, 0.0f, 0.0f};
1358 float dv2[3] = {0.0f, 0.0f, 0.0f};
1359 for (
int j = 1; j < point->
totkey; j++) {
1364 key = point->
keys + 1;
1366 dv1[0] = dv1[1] = dv1[2] = 0.0;
1371 dv0[0] = dv0[1] = dv0[2] = 0.0;
1374 for (; k < point->
totkey; k++, key++) {
1380 if (k < point->totkey - 1) {
1405 iter_data.
edit = edit;
1406 iter_data.
pset = pset;
1425 for (k = 0; k < point->totkey - 1; k++, key++) {
1426 key->length =
len_v3v3(key->co, (key + 1)->co);
1459 for (i = 0; i < totface; i++, vec += 6,
nor += 6) {
1536 float hairmat[4][4];
1559 float vec1[3], vec2[3], frs_sec, dfra;
1573 dfra = *(key + 1)->
time - *key->time;
1581 if (point->totkey > 2) {
1588 else if (k == point->totkey - 1) {
1589 dfra = *key->time - *(key - 1)->
time;
1597 if (point->totkey > 2) {
1605 dfra = *(key + 1)->
time - *(key - 1)->time;
1611 sub_v3_v3v3(key->vel, (key + 1)->co, (key - 1)->co);
1693 data->is_changed =
true;
1703 if (sel_op_result != -1) {
1706 data->is_changed =
true;
1740 data->is_changed =
true;
1756 data->is_changed =
true;
1768 data->is_changed =
true;
1779 bool changed =
false;
1835 bool changed =
false;
1852 ot->
name =
"(De)select All";
1853 ot->
idname =
"PARTICLE_OT_select_all";
1888 if (!extend && !deselect && !toggle) {
1904 else if (deselect) {
1911 if (
data.is_changed) {
1955 action =
data.select_toggle_action;
1958 data.select_action = action;
1961 if (
data.is_changed) {
1971 ot->
name =
"Select Roots";
1972 ot->
idname =
"PARTICLE_OT_select_roots";
1997 if (point->
totkey == 0) {
2028 action =
data.select_toggle_action;
2031 data.select_action = action;
2034 if (
data.is_changed) {
2046 ot->
name =
"Select Tips";
2047 ot->
idname =
"PARTICLE_OT_select_tips";
2121 if (
data.is_changed) {
2131 ot->
name =
"Select Random";
2132 ot->
idname =
"PARTICLE_OT_select_random";
2133 ot->
description =
"Select a randomly distributed set of hair or points";
2149 "Select either hair or points");
2175 ot->
name =
"Select Linked All";
2176 ot->
idname =
"PARTICLE_OT_select_linked";
2177 ot->
description =
"Select all keys linked to already selected ones";
2196 mval[0] = location[0];
2197 mval[1] = location[1];
2220 ot->
name =
"Select Linked";
2221 ot->
idname =
"PARTICLE_OT_select_linked_pick";
2222 ot->
description =
"Select nearest particle from mouse pointer";
2234 ot->
srna,
"deselect", 0,
"Deselect",
"Deselect linked keys rather than selecting them");
2246 bool changed =
false;
2288 data.sel_op = sel_op;
2301 if (
data.is_changed) {
2305 return data.is_changed;
2338 if (
data.is_changed) {
2342 return data.is_changed;
2361 float co[3], mat[4][4];
2391 const bool is_select = key->flag &
PEK_SELECT;
2396 mcoords, mcoords_len, screen_co[0], screen_co[1],
IS_CLIPPED) &&
2399 if (sel_op_result != -1) {
2402 data.is_changed =
true;
2407 if (point->totkey) {
2408 key = point->keys + point->totkey - 1;
2411 const bool is_select = key->flag &
PEK_SELECT;
2416 mcoords, mcoords_len, screen_co[0], screen_co[1],
IS_CLIPPED) &&
2419 if (sel_op_result != -1) {
2422 data.is_changed =
true;
2428 if (
data.is_changed) {
2482 ot->
name =
"Hide Selected";
2566 else if (k == point->
totkey - 1) {
2572 if ((((key - 1)->flag & (key + 1)->flag) &
PEK_SELECT) == 0) {
2582 data->is_changed =
true;
2603 ot->
name =
"Select Less";
2604 ot->
idname =
"PARTICLE_OT_select_less";
2605 ot->
description =
"Deselect boundary selected keys of each particle";
2637 else if (k == point->
totkey - 1) {
2643 if (((key - 1)->flag | (key + 1)->flag) &
PEK_SELECT) {
2654 data->is_changed =
true;
2675 ot->
name =
"Select More";
2676 ot->
idname =
"PARTICLE_OT_select_more";
2677 ot->
description =
"Select keys linked to boundary selected keys of each particle";
2701 HairKey *key, *new_keys, *okey;
2703 float dval, sta, end;
2721 end = (key +
data->totrekey - 1)->
time = (okey + pa->
totkey - 1)->time;
2722 dval = (end - sta) / (
float)(
data->totrekey - 1);
2725 for (k = 1, key++; k <
data->totrekey - 1; k++, key++) {
2729 key->
time = sta + k * dval;
2736 pa->
hair = new_keys;
2745 for (k = 0, key = pa->
hair; k < pa->totkey; k++, key++, ekey++) {
2781 ot->
description =
"Change the number of keys of selected particles (root and tip keys included)";
2792 RNA_def_int(
ot->
srna,
"keys_number", 2, 2, INT_MAX,
"Number of Keys",
"", 2, 100);
2808 if (!edit || !edit->
psys) {
2826 for (k = 1, key++; k < pa->
totkey; k++, key++) {
2836 pa->
hair = new_keys;
2839 for (k = 0, key = pa->
hair, ekey = edit->
points[pa_index].
keys; k < pa->totkey;
2840 k++, key++, ekey++) {
2861 int i, new_totpart = psys->
totpart, removed = 0;
2877 if (new_totpart != psys->
totpart) {
2881 "PTCacheEditKey array");
2883 if (
ELEM(
NULL, new_pars, new_points)) {
2897 for (i = 0; i < psys->
totpart; i++, pa++, point++) {
2922 edit->
points = new_points;
2945 HairKey *hkey, *nhkey, *new_hkeys = 0;
2966 new_totkey = point->totkey;
2971 if (new_totkey < 2) {
2985 if (new_totkey != pa->
totkey) {
2991 while (key->flag &
PEK_TAG && hkey < pa->hair + pa->
totkey) {
2996 if (hkey < pa->hair + pa->
totkey) {
3002 nkey->
co = nhkey->
co;
3005 nkey->
flag = key->flag;
3006 nkey->
ftime = key->ftime;
3007 nkey->
length = key->length;
3023 pa->
hair = new_hkeys;
3024 point->keys = new_keys;
3026 point->totkey = pa->
totkey = new_totkey;
3049 HairKey *key, *nkey, *new_keys;
3053 short totnewkey = 0;
3061 for (k = 0, ekey = point->
keys; k < pa->totkey - 1; k++, ekey++) {
3067 if (totnewkey == 0) {
3074 "Hair subdivide keys");
3076 "Hair subdivide edit keys");
3081 for (k = 0, ekey = point->
keys; k < pa->totkey - 1; k++, key++, ekey++) {
3083 memcpy(nkey, key,
sizeof(
HairKey));
3086 nekey->
co = nkey->
co;
3094 state.time = (endtime != 0.0f) ? nkey->
time / endtime : 0.0f;
3098 nekey->
co = nkey->
co;
3110 memcpy(nkey, key,
sizeof(
HairKey));
3113 nekey->
co = nkey->
co;
3119 pa->
hair = new_keys;
3124 point->
keys = new_ekeys;
3151 ot->
idname =
"PARTICLE_OT_subdivide";
3152 ot->
description =
"Subdivide selected particles segments (adds keys)";
3177 KDTreeNearest_3d nearest[10];
3180 int n, totn, removed, totremoved;
3201 BLI_kdtree_3d_insert(
tree, p, co);
3204 BLI_kdtree_3d_balance(
tree);
3213 totn = BLI_kdtree_3d_find_nearest_n(
tree, co, nearest, 10);
3215 for (n = 0; n < totn; n++) {
3217 if (nearest[n].index > p && nearest[n].dist < threshold) {
3218 if (!(point->flag &
PEP_TAG)) {
3226 BLI_kdtree_3d_free(
tree);
3230 totremoved += removed;
3233 if (totremoved == 0) {
3248 ot->
name =
"Remove Doubles";
3249 ot->
idname =
"PARTICLE_OT_remove_doubles";
3250 ot->
description =
"Remove selected particles close enough of others";
3266 "Threshold distance within which particles are removed",
3293 hkey = pa->
hair + k;
3308 ot->
idname =
"PARTICLE_OT_weight_set";
3324 "Interpolation factor between current brush weight, and keys' weights",
3389 {
DEL_KEY,
"KEY", 0,
"Key",
""},
3456 "Delete a full particle or only keys");
3476 int *mirrorfaces =
NULL;
3477 int rotation, totpart, newtotpart;
3519 if ((point->flag &
PEP_TAG) && mirrorfaces[pa->
num * 2] != -1) {
3524 if (newtotpart != psys->
totpart) {
3541 edit->
points = new_points;
3552 newpoint = edit->
points + totpart;
3554 for (p = 0, point = edit->
points; p < totpart; p++, point++) {
3556 const int pa_num = pa->
num;
3562 if (!(point->flag &
PEP_TAG) || mirrorfaces[pa_num * 2] == -1) {
3577 rotation = mirrorfaces[pa_num * 2 + 1];
3578 newpa->
fuv[0] = pa->
fuv[2];
3579 newpa->
fuv[1] = pa->
fuv[1];
3580 newpa->
fuv[2] = pa->
fuv[0];
3581 newpa->
fuv[3] = pa->
fuv[3];
3582 while (rotation--) {
3583 if (mtessface[pa_num].v4) {
3594 newpa->
num = mirrorfaces[pa_num * 2];
3596 if (use_dm_final_indices) {
3605 key = newpoint->
keys;
3606 for (k = 0, hkey = newpa->
hair; k < newpa->totkey; k++, hkey++, key++) {
3608 key->time = &hkey->
time;
3665 ot->
description =
"Duplicate and mirror the selected particles along the local X axis";
3687 float mouse_distance)
3696 fac = (
float)
pow((
double)(1.0f - mouse_distance /
data->rad), (
double)
data->combfac);
3713 float rad2, cut_time = 1.0;
3714 float x0, x1, v0,
v1, o0, o1, xo0, xo1, d, dv;
3715 int k, cut, keys = (int)
pow(2.0, (
double)pset->
draw_step);
3738 x0 = (
float)screen_co[0];
3739 x1 = (
float)screen_co[1];
3742 o1 = (
float)
data->mval[1];
3754 for (k = 1, key++; k <= keys; k++, key++) {
3759 x0 = (
float)screen_co[0];
3760 x1 = (
float)screen_co[1];
3767 v0 = (
float)screen_co[0] - x0;
3768 v1 = (
float)screen_co[1] - x1;
3770 dv = v0 * v0 +
v1 *
v1;
3772 d = (v0 * xo1 -
v1 * xo0);
3774 d = dv * rad2 - d * d;
3779 cut_time = -(v0 * xo0 +
v1 * xo1 + d);
3781 if (cut_time > 0.0f) {
3784 if (cut_time < 1.0f) {
3785 cut_time += (
float)(k - 1);
3786 cut_time /= (
float)keys;
3793 x0 = (
float)screen_co[0];
3794 x1 = (
float)screen_co[1];
3802 if (cut_time < 0.0f) {
3817 float dvec[3], pvec[3] = {0.0f, 0.0f, 0.0f};
3840 float mat[4][4], imat[4][4];
3844 float co_root[3], no_root[3];
3845 float co_prev[3], co[3];
3846 float fac = 0.0f, length_accum = 0.0f;
3847 bool puff_volume =
false;
3848 bool changed =
false;
3881 if (point_index == -1) {
3896 fac = (
float)
pow((
double)(1.0f - mouse_distance /
data->rad), (
double)
data->pufffac);
3962 float oco[3], onor[3];
3971 if (point_index != -1) {
4003 float UNUSED(imat[4][4]),
4007 float UNUSED(mouse_distance))
4023 float UNUSED(imat[4][4]),
4027 float UNUSED(mouse_distance))
4045 float UNUSED(mouse_distance))
4047 float vec[3], dvec[3];
4066 const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3],
float w[4])
4068 float co[3], vert[4][3];
4075 co[0] =
v1[0] *
w[0] +
v2[0] *
w[1] + v3[0] *
w[2] + v4[0] *
w[3];
4076 co[1] =
v1[1] *
w[0] +
v2[1] *
w[1] + v3[1] *
w[2] + v4[1] *
w[3];
4077 co[2] =
v1[2] *
w[0] +
v2[2] *
w[1] + v3[2] *
w[2] + v4[2] *
w[3];
4101 float cur_d, cur_uv[2],
v1[3],
v2[3], v3[3], v4[3],
min[3],
max[3], p_min[3], p_max[3];
4102 float cur_ipoint[3];
4125 if (pa_minmax == 0) {
4140 for (i = 0; i < totface; i++, mface++) {
4158 if (face_minmax == 0) {
4178 if (radius > 0.0f) {
4180 if (cur_d < *min_d) {
4189 if (cur_d < *min_d) {
4200 if (cur_d < *min_d) {
4202 min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
4203 min_w[1] = cur_uv[0];
4204 min_w[2] = cur_uv[1];
4215 if (cur_d < *min_d) {
4217 min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
4219 min_w[2] = cur_uv[0];
4220 min_w[3] = cur_uv[1];
4261 const int number = iter_data->
number;
4262 const short size = iter_data->
size;
4273 while (dmx * dmx + dmy * dmy > size2) {
4284 mco[0] =
data->mval[0] + dmx;
4285 mco[1] =
data->mval[1] + dmy;
4287 float co1[3], co2[3];
4334 void *__restrict join_v,
4335 void *__restrict chunk_v)
4343 void *__restrict chunk_v)
4363 int i, k, n = 0, totpart = psys->
totpart;
4364 float co1[3], imat[4][4];
4365 float framestep, timestep;
4383 sim.
psmd = psmd_eval;
4406 iter_data.
number = number;
4425 for (
int current_iter = 0, new_index = 0; current_iter < number; current_iter++) {
4429 if (new_index != current_iter) {
4433 memcpy(add_pars + new_index, add_pars + current_iter,
sizeof(
ParticleData));
4439 int newtotpart = totpart + n;
4440 float hairmat[4][4], cur_co[3];
4441 KDTree_3d *
tree = 0;
4445 "PTCacheEditPoint array new");
4462 edit->
points = new_points;
4473 for (i = 0, pa = psys->
particles; i < totpart; i++, pa++) {
4485 BLI_kdtree_3d_insert(
tree, i, cur_co);
4488 BLI_kdtree_3d_balance(
tree);
4495 point = edit->
points + totpart;
4497 for (i = totpart; i < newtotpart; i++, pa++, point++) {
4498 memcpy(pa, add_pars + i - totpart,
sizeof(
ParticleData));
4501 "PTCacheEditKey add");
4504 for (k = 0, hkey = pa->
hair; k < pa->totkey; k++, hkey++, key++) {
4527 KDTreeNearest_3d ptn[3];
4529 float maxd, totw = 0.0, weight[3];
4542 maxw = BLI_kdtree_3d_find_nearest_n(
tree, co1, ptn, 3);
4544 maxd = ptn[maxw - 1].dist;
4546 for (
w = 0;
w < maxw;
w++) {
4547 weight[
w] = (
float)
pow(2.0, (
double)(-6.0f * ptn[
w].dist / maxd));
4550 for (;
w < 3;
w++) {
4555 for (
w = 0;
w < maxw;
w++) {
4560 for (
w = 0;
w < maxw;
w++) {
4561 weight[
w] = 1.0f / maxw;
4569 thkey->
time = pa->
time + k * framestep;
4571 key3[0].
time = thkey->
time / 100.0f;
4602 for (k = 0, hkey = pa->
hair; k < pset->totaddkey; k++, hkey++) {
4604 hkey->
time += k * framestep;
4608 for (k = 0, hkey = pa->
hair; k < pset->totaddkey; k++, hkey++) {
4616 BLI_kdtree_3d_free(
tree);
4696 float vec[3], mousef[2];
4698 int flip, mouse[2], removed = 0, added = 0, selected = 0, tot_steps = 1, step = 1;
4707 mouse[0] = mousef[0];
4708 mouse[1] = mousef[1];
4729 (dx != 0 || dy != 0)) ||
4740 dx /= (
float)tot_steps;
4741 dy /= (
float)tot_steps;
4743 for (step = 1; step <= tot_steps; step++) {
4744 mval[0] = bedit->
lastmouse[0] + step * dx;
4745 mval[1] = bedit->
lastmouse[1] + step * dy;
4749 const float mval_f[2] = {dx, dy};
4754 if (
data.combfac < 0.0f) {
4755 data.combfac = 1.0f - 9.0f *
data.combfac;
4758 data.combfac = 1.0f -
data.combfac;
4799 if (brush->
invert ^ flip) {
4800 data.growfac = 1.0f -
data.growfac;
4803 data.growfac = 1.0f +
data.growfac;
4818 data.select = selected;
4821 if (
data.pufffac < 0.0f) {
4822 data.pufffac = 1.0f - 9.0f *
data.pufffac;
4825 data.pufffac = 1.0f -
data.pufffac;
4917 pset->
flag |= lock_root;
4976 switch (event->
type) {
5002 ot->
idname =
"PARTICLE_OT_brush_edit";
5003 ot->
description =
"Apply a stroke of brush to the particles";
5053 data->bvhdata.raycast_callback(&
data->bvhdata, index, ray, hit);
5055 if (hit->
index != -1) {
5064 const float dir[3] = {1.0f, 0.0f, 0.0f};
5077 return (userdata.
num_hits % 2) == 1;
5088 float cut_time = 1.0;
5105 for (k = 0; k < totkeys; k++, key++) {
5108 float co_curr_shape[3], co_next_shape[3];
5115 sub_v3_v3v3(dir_shape, co_next_shape, co_curr_shape);
5118 memset(&hit, 0,
sizeof(hit));
5120 hit.
dist = len_shape;
5126 data->shape_bvh.raycast_callback,
5128 if (hit.
index >= 0) {
5129 if (hit.
dist < len_shape) {
5130 cut_time = ((hit.
dist / len_shape) + (
float)k) / (
float)totkeys;
5139 if (cut_time < 0.0f) {
5211 pset->
flag |= lock_root;
5220 ot->
idname =
"PARTICLE_OT_shape_cut";
5221 ot->
description =
"Cut hair to conform to the set shape object";
5257 if (!(psys && psmd && psmd_eval->
mesh_final) && !cache) {
5269 edit = (psys) ? psys->
edit : cache->
edit;
5284 if (psys && !cache) {
5298 point->totkey = pa->
totkey;
5337 if (!point->totkey) {
5342 key = point->keys + point->totkey;
5359 if (psys && !cache) {
5384 if (psys->edit !=
NULL) {
5386 psys->free_edit(psys->edit);
5387 psys->free_edit =
NULL;
5413 if (edit && edit->
psys) {
5459 const bool is_mode_set = (ob->
mode & mode_flag) != 0;
5485 ot->
name =
"Particle Edit Toggle";
5486 ot->
idname =
"PARTICLE_OT_particle_edit_toggle";
5539 ot->
name =
"Clear Edited";
5540 ot->
idname =
"PARTICLE_OT_edited_clear";
5541 ot->
description =
"Undo all edition performed on the particle system";
5571 int num_selected = 0;
5572 float total_length = 0;
5578 if (num_selected == 0) {
5581 return total_length / num_selected;
5586 float orig_prev_co[3], prev_co[3];
5612 if (point_length != 0.0f) {
5613 const float factor =
length / point_length;
5636 if (average_length == 0.0f) {
5656 ot->
name =
"Unify Length";
5657 ot->
idname =
"PARTICLE_OT_unify_length";
typedef float(TangentPoint)[2]
BVHTree * BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, struct Mesh *mesh, const BVHCacheType bvh_cache_type, const int tree_type)
void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data)
struct 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
void BKE_mesh_tessface_ensure(struct Mesh *mesh)
struct Mesh * mesh_get_eval_deform(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, const struct CustomData_MeshMasks *dataMask)
struct Mesh * mesh_get_eval_final(struct Depsgraph *depsgraph, 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(struct Object *object)
void BKE_object_minmax(struct Object *ob, float r_min[3], float r_max[3], const bool use_hidden)
struct ParticleSystem * psys_eval_get(struct Depsgraph *depsgraph, struct Object *object, struct ParticleSystem *psys)
void psys_cache_edit_paths(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra, const bool use_render_params)
void psys_mat_hair_to_orco(struct Object *ob, struct Mesh *mesh, short from, struct ParticleData *pa, float hairmat[4][4])
void psys_get_particle_on_path(struct ParticleSimulationData *sim, int pa_num, struct ParticleKey *state, const bool vel)
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_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])
int psys_particle_dm_face_lookup(struct Mesh *mesh_final, struct Mesh *mesh_original, int findex, const float fw[4], struct LinkNode **poly_nodes)
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)
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)
@ BKE_PARTICLE_BATCH_DIRTY_ALL
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
@ PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL
#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
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain)
#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], const unsigned int mcoords_len, const int sx, const int sy, const 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_sweeping_sphere_tri_v3(const float p1[3], const float p2[3], const float radius, const float v0[3], const float v1[3], const float v2[3], float *r_lambda, float ipoint[3])
void interp_weights_poly_v3(float w[], float v[][3], const int n, const float co[3])
bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[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 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 void copy_v3fl_v3s(float r[3], const short a[3])
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_v3fl_v3fl_v3s(float r[3], const float a[3], const short b[3])
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])
void dist_ensure_v3_v3fl(float v1[3], const float v2[3], const float dist)
MINLINE void add_v3_v3(float r[3], const float a[3])
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(const int start, const 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 PSYS_HAIR_DYNAMICS
#define PSYS_HAIR_UPDATED
#define BPHYS_DATA_LOCATION
#define PTCACHE_DISK_CACHE
#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
@ V3D_RUNTIME_DEPTHBUF_OVERRIDDEN
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)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
int ED_select_op_action_deselected(const eSelectOp sel_op, const bool is_select, const bool is_inside)
bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph, const struct ARegion *region, struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], const bool do_clip)
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region, const float co[3], int r_co[2], const eV3DProjTest flag)
#define XRAY_ENABLED(v3d)
@ V3D_PROJ_TEST_CLIP_NEAR
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void ED_view3d_win_to_delta(const struct ARegion *region, const float mval[2], float out[3], const float zfac)
void ED_view3d_project(const struct ARegion *region, const float world[3], float r_region_co[3])
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, bool update_cache)
void view3d_operator_needs_opengl(const struct bContext *C)
float ED_view3d_select_dist_px(void)
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
@ GPU_SHADER_2D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_smooth(bool enable)
Read Guarded memory(de)allocation.
Utility defines for timing/benchmarks.
#define RNA_BEGIN(sptr, itemptr, propname)
StructRNA RNA_OperatorStrokeElement
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
static void mul(btAlignedObjectArray< T > &items, const Q &value)
static unsigned long seed
const Depsgraph * depsgraph
static bool is_inside(int x, int y, int cols, int rows)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
static void area(int d1, int d2, int e1, int e2, float weights[2])
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 toggle_key_select(PEData *data, int point_index, int key_index, bool UNUSED(is_inside))
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)
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)
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)
static void deselect_key_select(PEData *data, int point_index, int key_index, bool UNUSED(is_inside))
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)
void PARTICLE_OT_subdivide(wmOperatorType *ot)
static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
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)
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)
bool PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
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)
bool PE_circle_select(bContext *C, const int sel_op, const int mval[2], float rad)
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 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)
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 extend_key_select(PEData *data, int point_index, int key_index, bool UNUSED(is_inside))
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
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)
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
__forceinline BoundBox intersect(const BoundBox &a, const BoundBox &b)
ccl_device_inline float distance(const float2 &a, const float2 &b)
ccl_device_inline float dot(const float2 &a, const float2 &b)
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)