91 *r_totmirr = *r_totfail = 0;
167 *r_totmirr = totmirr;
168 *r_totfail = totfail;
216 #define FIND_NEAR_SELECT_BIAS 5
217 #define FIND_NEAR_CYCLE_THRESHOLD_MIN 3
238 const float screen_co[2],
242 float dist_test, dist_test_bias;
251 data->hit.dist_bias = dist_test_bias;
252 data->hit.dist = dist_test;
253 data->hit.index = index;
254 data->hit.vert = eve;
257 if (
data->use_cycle) {
258 if ((
data->hit_cycle.vert ==
NULL) && (index >
data->cycle_index_prev) &&
260 data->hit_cycle.dist_bias = dist_test_bias;
261 data->hit_cycle.dist = dist_test;
262 data->hit_cycle.index = index;
263 data->hit_cycle.vert = eve;
280 float *dist_px_manhattan_p,
291 *dist_px_manhattan_p);
311 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
313 *r_base_index = base_index;
315 *dist_px_manhattan_p = dist_px_manhattan_test;
337 data.use_select_bias = use_select_bias;
338 data.use_cycle = use_cycle;
340 for (; base_index < bases_len; base_index++) {
341 Base *base_iter = bases[base_index];
343 if (use_cycle && prev_select.bm == vc->
em->
bm &&
345 data.cycle_index_prev = prev_select.index;
350 data.cycle_index_prev = 0;
353 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
354 *dist_px_manhattan_p;
359 hit = (
data.use_cycle &&
data.hit_cycle.vert) ? &
data.hit_cycle : &
data.hit;
361 if (hit->
dist < *dist_px_manhattan_p) {
363 *r_base_index = base_index;
365 *dist_px_manhattan_p = hit->
dist;
366 prev_select_bm = vc->
em->
bm;
374 prev_select.index = hit->
index;
375 prev_select.elem = hit->
vert;
376 prev_select.bm = prev_select_bm;
396 const float screen_co_a[2],
397 const float screen_co_b[2],
402 if (eed ==
data->edge_test) {
404 float screen_co_mid[2];
406 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
409 if (dist_test < data->
dist) {
410 data->dist = dist_test;
439 void *userData,
BMEdge *eed,
const float screen_co_a[2],
const float screen_co_b[2],
int index)
442 float dist_test, dist_test_bias;
451 else if (fac >= 1.0f) {
475 float screen_co_mid[2];
477 data->hit.dist_bias = dist_test_bias;
478 data->hit.dist = dist_test;
479 data->hit.index = index;
480 data->hit.edge = eed;
482 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
486 if (
data->use_cycle) {
487 if ((
data->hit_cycle.edge ==
NULL) && (index >
data->cycle_index_prev) &&
489 float screen_co_mid[2];
491 data->hit_cycle.dist_bias = dist_test_bias;
492 data->hit_cycle.dist = dist_test;
493 data->hit_cycle.index = index;
494 data->hit_cycle.edge = eed;
496 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
503 float *dist_px_manhattan_p,
504 float *r_dist_center_px_manhattan,
516 *dist_px_manhattan_p);
540 if (r_dist_center_px_manhattan && eed) {
546 data.edge_test = eed;
553 *r_dist_center_px_manhattan =
data.dist;
558 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
560 *r_base_index = base_index;
562 *dist_px_manhattan_p = dist_px_manhattan_test;
584 data.use_select_bias = use_select_bias;
585 data.use_cycle = use_cycle;
587 for (; base_index < bases_len; base_index++) {
588 Base *base_iter = bases[base_index];
590 if (use_cycle && prev_select.bm == vc->
em->
bm &&
592 data.cycle_index_prev = prev_select.index;
597 data.cycle_index_prev = 0;
600 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
601 *dist_px_manhattan_p;
606 hit = (
data.use_cycle &&
data.hit_cycle.edge) ? &
data.hit_cycle : &
data.hit;
608 if (hit->
dist < *dist_px_manhattan_p) {
610 *r_base_index = base_index;
612 *dist_px_manhattan_p = hit->
dist;
613 prev_select_bm = vc->
em->
bm;
621 if (r_dist_center_px_manhattan) {
625 prev_select.index = hit->
index;
626 prev_select.elem = hit->
edge;
627 prev_select.bm = prev_select_bm;
636 vc, dist_px_manhattan_p,
NULL,
false,
false,
NULL, &base, 1,
NULL);
648 const float screen_co[2],
653 if (efa ==
data->face_test) {
657 data->dist_px_manhattan = dist_test;
681 const float screen_co[2],
685 float dist_test, dist_test_bias;
694 data->hit.dist_bias = dist_test_bias;
695 data->hit.dist = dist_test;
696 data->hit.index = index;
697 data->hit.face = efa;
700 if (
data->use_cycle) {
701 if ((
data->hit_cycle.face ==
NULL) && (index >
data->cycle_index_prev) &&
703 data->hit_cycle.dist_bias = dist_test_bias;
704 data->hit_cycle.dist = dist_test;
705 data->hit_cycle.index = index;
706 data->hit_cycle.face = efa;
719 float *dist_px_manhattan_p,
720 float *r_dist_center,
721 const bool use_zbuf_single_px,
737 uint dist_px_manhattan_test = 0;
738 if (*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px ==
false)) {
740 *dist_px_manhattan_p);
745 if (dist_px_manhattan_test == 0) {
752 dist_test = dist_px_manhattan_test;
768 if (r_dist_center && efa) {
773 data.dist_px_manhattan = FLT_MAX;
774 data.face_test = efa;
781 *r_dist_center =
data.dist_px_manhattan;
786 if (dist_test < *dist_px_manhattan_p) {
788 *r_base_index = base_index;
790 *dist_px_manhattan_p = dist_test;
810 data.use_select_bias = use_select_bias;
811 data.use_cycle = use_cycle;
813 for (; base_index < bases_len; base_index++) {
814 Base *base_iter = bases[base_index];
816 if (use_cycle && prev_select.bm == vc->
em->
bm &&
818 data.cycle_index_prev = prev_select.index;
823 data.cycle_index_prev = 0;
826 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
827 *dist_px_manhattan_p;
832 hit = (
data.use_cycle &&
data.hit_cycle.face) ? &
data.hit_cycle : &
data.hit;
834 if (hit->
dist < *dist_px_manhattan_p) {
836 *r_base_index = base_index;
838 *dist_px_manhattan_p = hit->
dist;
839 prev_select_bm = vc->
em->
bm;
848 *r_dist_center = hit->
dist;
851 prev_select.index = hit->
index;
852 prev_select.elem = hit->
face;
853 prev_select.bm = prev_select_bm;
862 vc, dist_px_manhattan_p,
NULL,
false,
false,
false,
NULL, &base, 1,
NULL);
865 #undef FIND_NEAR_SELECT_BIAS
866 #undef FIND_NEAR_CYCLE_THRESHOLD_MIN
875 const uint bases_len,
882 static short mval_prev[2] = {-1, -1};
884 const bool use_cycle = ((mval_prev[0] == vc->
mval[0]) && (mval_prev[1] == vc->
mval[1]));
887 const float dist_margin = (dist_init / 2);
888 float dist = dist_init;
908 float dist_center = 0.0f;
916 vc, &dist, dist_center_p,
true,
true, use_cycle, &efa_zbuf, bases, bases_len, &base_index);
918 if (efa_test && dist_center_p) {
919 dist =
min_ff(dist_margin, dist_center);
922 hit.f.base_index = base_index;
923 hit.f.ele = efa_test;
926 hit.f_zbuf.base_index = base_index;
927 hit.f_zbuf.ele = efa_zbuf;
932 float dist_center = 0.0f;
938 vc, &dist, dist_center_p,
true, use_cycle, &eed_zbuf, bases, bases_len, &base_index);
940 if (eed_test && dist_center_p) {
941 dist =
min_ff(dist_margin, dist_center);
944 hit.e.base_index = base_index;
945 hit.e.ele = eed_test;
948 hit.e_zbuf.base_index = base_index;
949 hit.e_zbuf.ele = eed_zbuf;
956 vc, &dist,
true, use_cycle, bases, bases_len, &base_index);
959 hit.v.base_index = base_index;
960 hit.v.ele = eve_test;
969 else if (hit.e.ele) {
975 if ((hit.v.ele || hit.e.ele || hit.f.ele) == 0) {
976 if (hit.e_zbuf.ele) {
977 hit.e.base_index = hit.e_zbuf.base_index;
978 hit.e.ele = hit.e_zbuf.ele;
980 else if (hit.f_zbuf.ele) {
981 hit.f.base_index = hit.f_zbuf.base_index;
982 hit.f.ele = hit.f_zbuf.ele;
986 mval_prev[0] = vc->
mval[0];
987 mval_prev[1] = vc->
mval[1];
993 *r_base_index = hit.v.base_index;
996 *r_base_index = hit.e.base_index;
999 *r_base_index = hit.f.base_index;
1006 return (hit.v.ele || hit.e.ele || hit.f.ele);
1009 #undef FAKE_SELECT_MODE_BEGIN
1010 #undef FAKE_SELECT_MODE_END
1014 const uint bases_len,
1034 const uint bases_len,
1035 bool use_boundary_vertices,
1036 bool use_boundary_edges,
1037 int *r_base_index_vert,
1038 int *r_base_index_edge,
1039 int *r_base_index_face,
1046 float ray_origin[3], ray_direction[3];
1058 } best_vert = {0,
NULL};
1063 } best_edge = {0,
NULL};
1068 } best_face = {0,
NULL};
1072 float dist_sq_best = FLT_MAX;
1073 float dist_sq_best_vert = FLT_MAX;
1074 float dist_sq_best_edge = FLT_MAX;
1075 float dist_sq_best_face = FLT_MAX;
1077 const bool use_vert = (r_eve !=
NULL);
1078 const bool use_edge = (r_eed !=
NULL);
1079 const bool use_face = (r_efa !=
NULL);
1081 for (
uint base_index = 0; base_index < bases_len; base_index++) {
1082 Base *base_iter = bases[base_index];
1101 if (coords !=
NULL) {
1105 if ((use_boundary_vertices || use_boundary_edges) && (use_vert || use_edge)) {
1110 if (use_vert && use_boundary_vertices) {
1111 for (
uint j = 0; j < 2; j++) {
1116 ray_origin, ray_direction, point);
1117 if (dist_sq_test < dist_sq_best_vert) {
1118 dist_sq_best_vert = dist_sq_test;
1119 best_vert.base_index = base_index;
1122 if (dist_sq_test < dist_sq_best) {
1123 dist_sq_best = dist_sq_test;
1124 best.base_index = base_index;
1130 if (use_edge && use_boundary_edges) {
1134 ray_origin, ray_direction,
e->v1->
co,
e->v2->
co, point, &depth);
1145 ray_origin, ray_direction, point);
1146 if (dist_sq_test < dist_sq_best_edge) {
1147 dist_sq_best_edge = dist_sq_test;
1148 best_edge.base_index = base_index;
1151 if (dist_sq_test < dist_sq_best) {
1152 dist_sq_best = dist_sq_test;
1153 best.base_index = base_index;
1162 if (use_vert && !use_boundary_vertices) {
1170 ray_origin, ray_direction, point);
1171 if (dist_sq_test < dist_sq_best_vert) {
1172 dist_sq_best_vert = dist_sq_test;
1173 best_vert.base_index = base_index;
1176 if (dist_sq_test < dist_sq_best) {
1177 dist_sq_best = dist_sq_test;
1178 best.base_index = base_index;
1185 if (use_edge && !use_boundary_edges) {
1200 ray_origin, ray_direction, point);
1201 if (dist_sq_test < dist_sq_best_edge) {
1202 dist_sq_best_edge = dist_sq_test;
1203 best_edge.base_index = base_index;
1206 if (dist_sq_test < dist_sq_best) {
1207 dist_sq_best = dist_sq_test;
1208 best.base_index = base_index;
1229 ray_origin, ray_direction, point);
1230 if (dist_sq_test < dist_sq_best_face) {
1231 dist_sq_best_face = dist_sq_test;
1232 best_face.base_index = base_index;
1233 best_face.ele = (
BMElem *)f;
1235 if (dist_sq_test < dist_sq_best) {
1236 dist_sq_best = dist_sq_test;
1237 best.base_index = base_index;
1246 *r_base_index_vert = best_vert.base_index;
1247 *r_base_index_edge = best_edge.base_index;
1248 *r_base_index_face = best_face.base_index;
1260 if (best_vert.ele) {
1261 *r_eve = (
BMVert *)best_vert.ele;
1263 if (best_edge.ele) {
1264 *r_eed = (
BMEdge *)best_edge.ele;
1266 if (best_face.ele) {
1267 *r_efa = (
BMFace *)best_face.ele;
1270 return (best_vert.ele !=
NULL || best_edge.ele !=
NULL || best_face.ele !=
NULL);
1284 bool changed =
false;
1288 int(*group_index)[2];
1303 for (i = 0; i < group_tot; i++) {
1307 const int fg_sta = group_index[i][0];
1308 const int fg_len = group_index[i][1];
1312 for (j = 0; j < fg_len; j++) {
1324 while ((f = *(
faces++))) {
1352 ot->
name =
"Select Similar Regions";
1353 ot->
idname =
"MESH_OT_select_similar_region";
1354 ot->
description =
"Select similar face regions to the current selection";
1414 {0,
"DISABLE", 0,
"Disable",
"Disable selected markers"},
1415 {1,
"ENABLE", 0,
"Enable",
"Enable selected markers"},
1416 {2,
"TOGGLE", 0,
"Toggle",
"Toggle disabled flag for selected markers"},
1421 ot->
name =
"Select Mode";
1422 ot->
idname =
"MESH_OT_select_mode";
1443 ot->
srna,
"action", actions_items, 2,
"Action",
"Selection action to execute");
1456 int r_count_by_select[2])
1462 r_count_by_select[0] = r_count_by_select[1] = 0;
1477 if (r_count_by_select[0] && r_count_by_select[1]) {
1478 r_count_by_select[0] = r_count_by_select[1] = -1;
1514 uint objects_len = 0;
1517 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1518 Object *obedit = objects[ob_index];
1542 edarray[edindex] = eed;
1548 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1549 eed = edarray[edindex];
1555 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1556 eed = edarray[edindex];
1581 ot->
name =
"Multi Select Loops";
1582 ot->
idname =
"MESH_OT_loop_multi_select";
1583 ot->
description =
"Select a loop of connected edges by connection type";
1623 bool edge_boundary =
false;
1628 int count_by_select[2];
1632 if (count_by_select[!
select] == 0) {
1633 edge_boundary =
true;
1637 if (count_by_select[!
select] == 0) {
1638 edge_boundary =
false;
1647 if (edge_boundary) {
1650 else if (non_manifold) {
1659 bContext *
C,
const int mval[2],
bool extend,
bool deselect,
bool toggle,
bool ring)
1669 bool select_clear =
false;
1670 bool select_cycle =
true;
1674 mvalf[0] = (
float)(vc.
mval[0] = mval[0]);
1675 mvalf[1] = (
float)(vc.
mval[1] = mval[1]);
1678 const short selectmode = em_original->
selectmode;
1685 int base_index = -1;
1687 basact = bases[base_index];
1703 if (extend ==
false && deselect ==
false && toggle ==
false) {
1704 select_clear =
true;
1710 else if (deselect) {
1718 select_cycle =
false;
1722 for (
uint base_index = 0; base_index < bases_len; base_index++) {
1723 Base *base_iter = bases[base_index];
1731 if (em_iter == em) {
1759 float v1_co[2], v2_co[2];
1760 float length_1 = FLT_MAX;
1761 float length_2 = FLT_MAX;
1776 printf(
"mouse to v1: %f\nmouse to v2: %f\n",
1789 float best_dist = FLT_MAX;
1804 if (tdist < best_dist) {
1846 ot->
name =
"Loop Select";
1847 ot->
idname =
"MESH_OT_loop_select";
1867 ot->
name =
"Edge Ring Select";
1868 ot->
idname =
"MESH_OT_edgering_select";
1895 uint objects_len = 0;
1901 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1902 Object *obedit = objects[ob_index];
1911 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1912 Object *obedit = objects[ob_index];
1938 ot->
name =
"(De)select All";
1940 ot->
description =
"(De)select all vertices, edges or faces";
1961 uint objects_len = 0;
1965 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1966 Object *obedit = objects[ob_index];
1984 ot->
name =
"Select Interior Faces";
1985 ot->
idname =
"MESH_OT_select_interior_faces";
1986 ot->
description =
"Select faces where all edges have more than 2 face users";
2009 int base_index_active = -1;
2016 vc.
mval[0] = mval[0];
2017 vc.
mval[1] = mval[1];
2025 Base *basact = bases[base_index_active];
2029 if (extend ==
false && deselect ==
false && toggle ==
false) {
2030 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2031 Base *base_iter = bases[base_index];
2034 if (basact->
object != ob_iter) {
2053 else if (deselect) {
2080 else if (deselect) {
2104 else if (deselect) {
2133 if (cd_fmap_offset != -1) {
2178 nextese = ese->
next;
2188 nextese = ese->
next;
2198 nextese = ese->
next;
2278 const short selectmode_old,
2279 const short selectmode_new)
2385 const short selectmode_new,
2387 const bool use_extend,
2388 const bool use_expand)
2405 bool only_update =
false;
2412 if ((em->
selectmode & selectmode_new) == 0) {
2420 if ((em->
selectmode & selectmode_new) != 0) {
2439 uint objects_len = 0;
2443 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2444 Object *ob_iter = objects[ob_index];
2446 if (em_iter != em) {
2456 if (use_extend == 0 || em->
selectmode == 0) {
2459 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2460 Object *ob_iter = objects[ob_index];
2467 switch (selectmode_new) {
2469 if (use_extend == 0 || em->
selectmode == 0) {
2475 if (use_extend == 0 || em->
selectmode == 0) {
2481 if (use_extend == 0 || em->
selectmode == 0) {
2494 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2495 Object *ob_iter = objects[ob_index];
2513 bool changed =
false;
2535 uint objects_len = 0;
2539 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2540 Object *ob_iter = objects[ob_index];
2567 const short selectmode_disable,
2568 const short selectmode_fallback)
2599 bool changed =
false;
2605 if (efa->
mat_nr == index) {
2658 bool changed_multi =
false;
2659 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2660 Base *base_iter = bases[base_index];
2670 changed_multi =
true;
2672 return changed_multi;
2685 return changed_multi;
2689 struct Base **bases,
2690 const uint bases_len,
2691 const short selectmode_disable,
2692 const short selectmode_fallback)
2694 bool changed_multi =
false;
2695 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2696 Base *base_iter = bases[base_index];
2701 changed_multi =
true;
2704 return changed_multi;
2708 const short selectmode_disable,
2709 const short selectmode_fallback)
2719 scene, bases, bases_len, selectmode_disable, selectmode_fallback);
2721 return changed_multi;
2761 if (!
ELEM(i, -1, face_index)) {
2762 if (loop_index == 2) {
2765 r_l_pair[loop_index++] = l_iter;
2768 return (loop_index == 2);
2783 BMFace *f = f_link->face;
2784 area += f_link->area;
2787 BMLoop *l_iter, *l_first;
2791 float cost_test = 0.0f;
2794 BMLoop *l_radial_iter = l_iter;
2797 if (!
ELEM(i_other, -1, i)) {
2813 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
2815 if (cost_count >= 2) {
2820 }
while ((l_iter = l_iter->
next) != l_first);
2822 return found ? cost /
area : FLT_MAX;
2829 bool changed =
false;
2834 bool has_nonmanifold =
false;
2841 has_nonmanifold =
true;
2846 edge_lengths[i] = -1.0;
2853 if (has_nonmanifold ==
false) {
2861 int(*fgroup_index)[2];
2868 int *fgroup_recalc_stack =
MEM_mallocN(
sizeof(*fgroup_recalc_stack) * fgroup_len, __func__);
2885 for (
int i = 0; i < fgroup_len; i++) {
2886 const int fg_sta = fgroup_index[i][0];
2887 const int fg_len = fgroup_index[i][1];
2888 for (
int j = 0; j < fg_len; j++) {
2889 const int face_index = fgroup_array[fg_sta + j];
2893 struct BMFaceLink *f_link = &f_link_array[face_index];
2905 bool *fgroup_dirty =
MEM_callocN(
sizeof(*fgroup_dirty) * fgroup_len, __func__);
2907 for (
int i = 0; i < fgroup_len; i++) {
2909 if (cost != FLT_MAX) {
2913 fgroup_table[i] =
NULL;
2925 #define USE_DELAY_FACE_GROUP_COST_CALC
2929 #if defined(USE_DELAY_FACE_GROUP_COST_CALC)
2933 if (fgroup_dirty[i]) {
2935 if (cost != FLT_MAX) {
2943 fgroup_table[i] =
NULL;
2945 fgroup_dirty[i] =
false;
2960 fgroup_table[i_min] =
NULL;
2964 while ((f_link =
BLI_pophead(&fgroup_listbase[i_min]))) {
2969 BMLoop *l_iter, *l_first;
2985 SWAP(
int, i_a, i_b);
2990 BMFace *f_iter = n->data;
2998 fgroup_table[i_b] =
NULL;
3003 if (fgroup_dirty[i_a] ==
false) {
3006 fgroup_dirty[i_a] =
true;
3013 if (l_radial_iter != l_iter) {
3016 if (!
ELEM(i_other, -1, i_min)) {
3017 if ((fgroup_table[i_other] !=
NULL) && (fgroup_dirty[i_other] ==
false)) {
3018 #if !defined(USE_DELAY_FACE_GROUP_COST_CALC)
3021 fgroup_dirty[i_other] =
true;
3024 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
3027 }
while ((l_iter = l_iter->
next) != l_first);
3030 for (
int index = 0; index <
STACK_SIZE(fgroup_recalc_stack); index++) {
3031 const int i = fgroup_recalc_stack[index];
3032 if (fgroup_table[i] !=
NULL && fgroup_dirty[i] ==
true) {
3035 if (cost != FLT_MAX) {
3040 fgroup_table[i] =
NULL;
3043 fgroup_dirty[i] =
false;
3069 #define USE_LINKED_SELECT_DEFAULT_HACK
3101 if (
e->l &&
e->l->radial_next !=
e->l) {
3102 const short mat_nr =
e->l->f->mat_nr;
3103 BMLoop *l_iter =
e->l->radial_next;
3105 if (l_iter->
f->
mat_nr != mat_nr) {
3122 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3131 char *delimit_last = &delimit_last_store[delimit_last_index];
3137 *delimit_last = delimit;
3140 delimit = *delimit_last;
3195 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3202 uint objects_len = 0;
3206 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3207 Object *obedit = objects[ob_index];
3214 int delimit = delimit_init;
3403 ot->
name =
"Select Linked All";
3404 ot->
idname =
"MESH_OT_select_linked";
3405 ot->
description =
"Select all vertices connected to the current selection";
3419 "Delimit selected region");
3420 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3462 BMW_ITER (ele_walk, &walker, eve) {
3499 BMW_ITER (ele_walk, &walker, eed) {
3574 bool has_edges =
false;
3575 for (
uint base_index = 0; base_index < bases_len; base_index++) {
3582 if (has_edges ==
false) {
3588 vc.
mval[0] =
event->mval[0];
3589 vc.
mval[1] =
event->mval[1];
3593 int base_index = -1;
3594 const bool ok =
unified_findnearest(&vc, bases, bases_len, &base_index, &eve, &eed, &efa);
3599 basact = bases[base_index];
3606 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3654 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3673 ot->
name =
"Select Linked";
3674 ot->
idname =
"MESH_OT_select_linked_pick";
3675 ot->
description =
"(De)select all vertices linked to the edge under the mouse cursor";
3691 "Delimit selected region");
3692 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3697 prop =
RNA_def_int(
ot->
srna,
"object_index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
3712 uint objects_len = 0;
3719 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3720 Object *obedit = objects[ob_index];
3769 {0,
"LESS", 0,
"Less Than",
""},
3770 {1,
"EQUAL", 0,
"Equal To",
""},
3771 {2,
"GREATER", 0,
"Greater Than",
""},
3772 {3,
"NOTEQUAL", 0,
"Not Equal To",
""},
3777 ot->
name =
"Select Faces by Sides";
3778 ot->
description =
"Select vertices or faces by the number of polygon sides";
3779 ot->
idname =
"MESH_OT_select_face_by_sides";
3789 RNA_def_int(
ot->
srna,
"number", 4, 3, INT_MAX,
"Number of Vertices",
"", 3, INT_MAX);
3805 uint objects_len = 0;
3809 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3810 Object *obedit = objects[ob_index];
3842 bool is_loose =
true;
3869 ot->
name =
"Select Loose Geometry";
3870 ot->
description =
"Select loose geometry based on the selection mode";
3871 ot->
idname =
"MESH_OT_select_loose";
3898 int tot_mirr = 0, tot_fail = 0;
3900 uint objects_len = 0;
3904 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3905 Object *obedit = objects[ob_index];
3912 int tot_mirr_iter = 0, tot_fail_iter = 0;
3914 for (
int axis = 0; axis < 3; axis++) {
3915 if ((1 << axis) & axis_flag) {
3920 if (tot_mirr_iter) {
3927 tot_fail += tot_fail_iter;
3928 tot_mirr += tot_mirr_iter;
3932 if (tot_mirr || tot_fail) {
3941 ot->
name =
"Select Mirror";
3942 ot->
description =
"Select mesh items at mirrored locations";
3943 ot->
idname =
"MESH_OT_select_mirror";
3969 uint objects_len = 0;
3972 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3973 Object *obedit = objects[ob_index];
3993 ot->
name =
"Select More";
3994 ot->
idname =
"MESH_OT_select_more";
3995 ot->
description =
"Select more vertices, edges or faces connected to initial selection";
4005 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4019 uint objects_len = 0;
4022 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4023 Object *obedit = objects[ob_index];
4043 ot->
name =
"Select Less";
4044 ot->
idname =
"MESH_OT_select_less";
4045 ot->
description =
"Deselect vertices, edges or faces at the boundary of each selection region";
4055 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4096 int walktype = 0, itertype = 0, flushtype = 0;
4097 short mask_vert = 0, mask_edge = 0, mask_face = 0;
4100 if (h_act ==
NULL) {
4106 switch (h_act->
htype) {
4257 bool found_active_elt =
false;
4259 uint objects_len = 0;
4263 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4264 Object *obedit = objects[ob_index];
4272 found_active_elt =
true;
4278 if (!found_active_elt) {
4289 ot->
name =
"Checker Deselect";
4291 ot->
description =
"Deselect every Nth element starting from the active vertex, edge or face";
4328 uint objects_len = 0;
4332 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4333 Object *obedit = objects[ob_index];
4344 if (angle_cos < angle_limit_cos) {
4370 ot->
name =
"Select Sharp Edges";
4372 ot->
idname =
"MESH_OT_edges_select_sharp";
4404 uint objects_len = 0;
4409 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4410 Object *obedit = objects[ob_index];
4420 BMIter iter, liter, liter2;
4453 if (angle_cos > angle_limit_cos) {
4476 ot->
name =
"Select Linked Flat Faces";
4478 ot->
idname =
"MESH_OT_faces_select_linked_flat";
4517 uint objects_len = 0;
4521 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4522 Object *obedit = objects[ob_index];
4552 if (use_wire || use_boundary || use_multi_face || use_non_contiguous) {
4580 ot->
name =
"Select Non-Manifold";
4581 ot->
description =
"Select all non-manifold vertices or edges";
4582 ot->
idname =
"MESH_OT_select_non_manifold";
4597 ot->
srna,
"use_multi_face",
true,
"Multiple Faces",
"Edges shared by more than two faces");
4599 "use_non_contiguous",
4602 "Edges between faces pointing in alternate directions");
4605 ot->
srna,
"use_verts",
true,
"Vertices",
"Vertices connecting multiple face regions");
4622 uint objects_len = 0;
4625 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4626 Object *obedit = objects[ob_index];
4629 int seed_iter =
seed;
4637 int elem_map_len = 0;
4642 elem_map[elem_map_len++] = eve;
4647 const int count_select = elem_map_len * randfac;
4648 for (
int i = 0; i < count_select; i++) {
4654 int elem_map_len = 0;
4659 elem_map[elem_map_len++] = eed;
4663 const int count_select = elem_map_len * randfac;
4664 for (
int i = 0; i < count_select; i++) {
4670 int elem_map_len = 0;
4675 elem_map[elem_map_len++] = efa;
4679 const int count_select = elem_map_len * randfac;
4680 for (
int i = 0; i < count_select; i++) {
4705 ot->
name =
"Select Random";
4707 ot->
idname =
"MESH_OT_select_random";
4751 uint objects_len = 0;
4755 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4756 Object *obedit = objects[ob_index];
4761 if (cd_dvert_offset == -1) {
4768 bool changed =
false;
4801 ot->
name =
"Select Ungrouped";
4802 ot->
idname =
"MESH_OT_select_ungrouped";
4838 if (v_act ==
NULL) {
4840 op->
reports,
RPT_WARNING,
"This operator requires an active vertex (last selected)");
4847 float axis_mat[3][3];
4853 const float *axis_vector = axis_mat[axis];
4856 float vertex_world[3];
4858 value =
dot_v3v3(axis_vector, vertex_world);
4868 uint objects_len = 0;
4871 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4872 Object *obedit_iter = objects[ob_index];
4882 bool changed =
false;
4886 float v_iter_world[3];
4888 const float value_iter =
dot_v3v3(axis_vector, v_iter_world);
4891 if (
fabsf(value_iter - value) < limit) {
4897 if (value_iter < value) {
4903 if (value_iter > value) {
4931 ot->
name =
"Select Axis";
4932 ot->
description =
"Select all data in the mesh on a single axis";
4933 ot->
idname =
"MESH_OT_select_axis";
4948 "Axis orientation");
4955 "Select the axis to compare each vertex on");
4957 ot->
srna,
"threshold", 0.0001f, 0.000001f, 50.0f,
"Threshold",
"", 0.00001f, 10.0f);
4969 uint objects_len = 0;
4972 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4973 Object *obedit = objects[ob_index];
4990 int tot = 0, totsel = 0;
4997 if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1)) {
5030 ot->
name =
"Select Boundary Loop";
5031 ot->
idname =
"MESH_OT_region_to_loop";
5032 ot->
description =
"Select boundary edges around the selected faces";
5087 *region_out = region;
5116 GSet *visit_face_set;
5123 edges =
MEM_mallocN(
sizeof(*edges) * edges_len, __func__);
5137 qsort(edges, edges_len,
sizeof(*edges),
verg_radial);
5139 for (i = 0; i < edges_len; i++) {
5158 if (!region || (selbigger ?
c >= tot :
c < tot)) {
5166 region = region_out;
5177 for (j = 0; j < tot; j++) {
5201 uint objects_len = 0;
5204 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
5205 Object *obedit = objects[ob_index];
5244 ot->
name =
"Select Loop Inner-Region";
5245 ot->
idname =
"MESH_OT_loop_to_region";
5246 ot->
description =
"Select region of faces inside of a selected loop of edges";
5259 "Select bigger regions instead of smaller ones");
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
struct Object * CTX_data_edit_object(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
struct View3D * CTX_wm_view3d(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct SpaceImage * CTX_wm_space_image(const bContext *C)
struct ToolSettings * CTX_data_tool_settings(const bContext *C)
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
bool CustomData_has_layer(const struct CustomData *data, int type)
int CustomData_get_offset(const struct CustomData *data, int type)
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
#define BKE_view_layer_array_from_bases_in_edit_mode(view_layer, v3d, r_len)
#define BKE_view_layer_array_from_objects_in_edit_mode(view_layer, v3d, r_len)
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
#define BKE_view_layer_array_from_bases_in_edit_mode_unique_data(view_layer, v3d, r_len)
void BKE_report(ReportList *reports, ReportType type, const char *message)
A (mainly) macro array library.
#define BLI_array_append(arr, item)
#define BLI_array_pop(arr)
#define BLI_array_declare(arr)
#define BLI_array_len(arr)
#define BLI_array_free(arr)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
void BLI_gset_insert(GSet *gs, void *key)
bool BLI_gset_haskey(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
GSet * BLI_gset_ptr_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
bool BLI_gset_add(GSet *gs, void *key)
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
Heap * BLI_heap_new_ex(unsigned int tot_reserve) ATTR_WARN_UNUSED_RESULT
void void float BLI_heap_node_value(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
void * BLI_heap_node_ptr(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
HeapNode * BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_SIZE(var)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count_at_most(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE unsigned short highest_order_bit_s(unsigned short n)
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
float dist_squared_ray_to_seg_v3(const float ray_origin[3], const float ray_direction[3], const float v0[3], const float v1[3], float r_point[3], float *r_depth)
float dist_squared_to_ray_v3_normalized(const float ray_origin[3], const float ray_direction[3], const float co[3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
void mul_v3_m4v3(float r[3], const float M[4][4], const float v[3])
bool invert_m3(float R[3][3])
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_tot, unsigned int seed)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define STACK_CLEAR(stack)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_INIT(stack, tot)
#define STACK_SIZE(stack)
struct Depsgraph Depsgraph
void DEG_id_tag_update(struct ID *id, int flag)
struct ID * DEG_get_evaluated_id(const struct Depsgraph *depsgraph, struct ID *id)
@ ID_RECALC_COPY_ON_WRITE
Object is a sort of wrapper for general info.
#define UV_SYNC_SELECTION
#define SCE_SELECT_VERTEX
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
bool DRW_select_buffer_elem_get(const uint sel_id, uint *r_elem, uint *r_base_index, char *r_elem_type)
uint DRW_select_buffer_find_nearest_to_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], const uint id_min, const uint id_max, uint *dist)
void DRW_select_buffer_context_create(struct Base **bases, const uint bases_len, short select_mode)
uint DRW_select_buffer_sample_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2])
void EDBM_selectmode_to_scene(struct bContext *C)
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, const short selectmode)
void EDBM_select_more(struct BMEditMesh *em, const bool use_face_step)
struct BMFace * EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f)
void EDBM_flag_enable_all(struct BMEditMesh *em, const char hflag)
void EDBM_select_flush(struct BMEditMesh *em)
void EDBM_select_less(struct BMEditMesh *em, const bool use_face_step)
struct BMVert * EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v)
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em)
void EDBM_update_generic(struct Mesh *me, const bool do_tessellation, const bool is_destructive)
void EDBM_deselect_flush(struct BMEditMesh *em)
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const int axis, const bool use_self, const bool use_select, const bool respecthide, const bool use_topology)
void ED_mesh_report_mirror_ex(struct wmOperator *op, int totmirr, int totfail, char selectmode)
struct BMEdge * EDBM_verts_mirror_get_edge(struct BMEditMesh *em, struct BMEdge *e)
void EDBM_flag_disable_all(struct BMEditMesh *em, const char hflag)
void EDBM_selectmode_flush(struct BMEditMesh *em)
void ED_object_base_activate(struct bContext *C, struct Base *base)
bool ED_operator_editmesh_region_view3d(struct bContext *C)
bool ED_operator_editmesh(struct bContext *C)
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
@ V3D_PROJ_TEST_CLIP_NEAR
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
void mesh_foreachScreenFace(struct ViewContext *vc, void(*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag)
void mesh_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
#define XRAY_FLAG_ENABLED(v3d)
void view3d_operator_needs_opengl(const struct bContext *C)
bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], const bool is_local)
float ED_view3d_select_dist_px(void)
bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3], const bool do_clip)
void mesh_foreachScreenEdge(struct ViewContext *vc, void(*func)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *userData, const eV3DProjTest clip_flag)
int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, const float dist)
_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
Read Guarded memory(de)allocation.
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_set(ele, hflag, val)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
void BM_mesh_deselect_flush(BMesh *bm)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
BMVert * BM_mesh_active_vert_get(BMesh *bm)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
#define BM_select_history_store(bm, ele)
#define BM_select_history_remove(bm, ele)
void BM_mesh_elem_toolflags_clear(BMesh *bm)
BMEdge * BM_edge_at_index_find_or_table(BMesh *bm, const int index)
void BM_mesh_elem_toolflags_ensure(BMesh *bm)
BMFace * BM_face_at_index_find_or_table(BMesh *bm, const int index)
BMVert * BM_vert_at_index_find_or_table(BMesh *bm, const int index)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
#define BMO_edge_flag_test(bm, e, oflag)
void BMO_pop(BMesh *bm)
BMESH OPSTACK POP.
#define BMO_edge_flag_set(bm, e, oflag, val)
void BMO_push(BMesh *bm, BMOperator *op)
#define BMO_elem_flag_enable(bm, ele, oflag)
float BM_face_calc_area(const BMFace *f)
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], float const (*vertexCos)[3])
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
bool BM_edge_is_contiguous_loop_cd(const BMEdge *e, const int cd_loop_type, const int cd_loop_offset)
bool BM_edge_is_all_face_flag_test(const BMEdge *e, const char hflag, const bool respect_hide)
int BM_mesh_calc_face_groups(BMesh *bm, int *r_groups_array, int(**r_group_index)[2], BMLoopFilterFunc filter_fn, BMLoopPairFilterFunc filter_pair_fn, void *user_data, const char hflag_test, const char htype_step)
bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag)
bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
bool BM_vert_is_all_edge_flag_test(const BMVert *v, const char hflag, const bool respect_hide)
bool BM_vert_is_manifold(const BMVert *v)
int BM_edge_face_count(const BMEdge *e)
bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag)
float BM_edge_calc_length(const BMEdge *e)
bool BM_vert_is_all_face_flag_test(const BMVert *v, const char hflag, const bool respect_hide)
bool BM_edge_is_any_face_flag_test(const BMEdge *e, const char hflag)
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define BM_edge_face_count_is_over(e, n)
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
int BM_mesh_region_match(BMesh *bm, BMFace **faces_region, uint faces_region_len, ListBase *r_face_regions)
void BMW_init(BMWalker *walker, BMesh *bm, int type, short mask_vert, short mask_edge, short mask_face, BMWFlag flag, int layer)
Init Walker.
void BMW_end(BMWalker *walker)
End Walker.
int BMW_current_depth(BMWalker *walker)
Walker Current Depth.
void * BMW_begin(BMWalker *walker, void *start)
void * BMW_step(BMWalker *walker)
Step Walker.
@ BMW_EDGELOOP_NONMANIFOLD
#define BMW_ITER(ele, walker, data)
static unsigned long seed
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
const Depsgraph * depsgraph
static int edbm_select_all_exec(bContext *C, wmOperator *op)
static void walker_select_count(BMEditMesh *em, int walkercode, void *start, int r_count_by_select[2])
void MESH_OT_select_less(wmOperatorType *ot)
bool EDBM_mesh_deselect_all_multi_ex(struct Base **bases, const uint bases_len)
static int edbm_select_random_exec(bContext *C, wmOperator *op)
static float bm_interior_face_group_calc_cost(ListBase *ls, const float *edge_lengths)
static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
void em_setup_viewcontext(bContext *C, ViewContext *vc)
void MESH_OT_loop_to_region(wmOperatorType *ot)
void MESH_OT_select_mode(wmOperatorType *ot)
void EDBM_select_toggle_all(BMEditMesh *em)
static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void select_linked_delimit_end(BMEditMesh *em)
void MESH_OT_select_similar_region(wmOperatorType *ot)
#define FIND_NEAR_SELECT_BIAS
static int edbm_select_mode_exec(bContext *C, wmOperator *op)
static int edbm_select_linked_pick_exec(bContext *C, wmOperator *op)
static int edbm_region_to_loop_exec(bContext *C, wmOperator *UNUSED(op))
void MESH_OT_select_linked_pick(wmOperatorType *ot)
static int edbm_select_ungrouped_exec(bContext *C, wmOperator *op)
static int edbm_select_more_exec(bContext *C, wmOperator *op)
static int loop_find_region(BMLoop *l, int flag, GSet *visit_face_set, BMFace ***region_out)
BMFace * EDBM_face_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan_p, float *r_dist_center, const bool use_zbuf_single_px, const bool use_select_bias, bool use_cycle, BMFace **r_efa_zbuf, Base **bases, uint bases_len, uint *r_base_index)
void EDBM_select_swap(BMEditMesh *em)
static void findnearestvert__doClosest(void *userData, BMVert *eve, const float screen_co[2], int index)
static int edbm_loop_to_region_exec(bContext *C, wmOperator *op)
static void mouse_mesh_loop_edge_ring(BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
static void mouse_mesh_loop_face(BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
void EDBM_selectmode_set(BMEditMesh *em)
static BMElem * edbm_select_id_bm_elem_get(Base **bases, const uint sel_id, uint *r_base_index)
static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool ring)
static void walker_deselect_nth(BMEditMesh *em, const struct CheckerIntervalParams *op_params, BMHeader *h_act)
void MESH_OT_select_random(wmOperatorType *ot)
bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, Base **bases, const uint bases_len, bool use_boundary_vertices, bool use_boundary_edges, int *r_base_index_vert, int *r_base_index_edge, int *r_base_index_face, struct BMVert **r_eve, struct BMEdge **r_eed, struct BMFace **r_efa)
static bool unified_findnearest(ViewContext *vc, Base **bases, const uint bases_len, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
static int verg_radial(const void *va, const void *vb)
static int loop_find_regions(BMEditMesh *em, const bool selbigger)
void MESH_OT_select_nth(wmOperatorType *ot)
bool EDBM_selectmode_disable_multi(struct bContext *C, const short selectmode_disable, const short selectmode_fallback)
static int edbm_select_mirror_exec(bContext *C, wmOperator *op)
static int edbm_select_loose_exec(bContext *C, wmOperator *op)
static void find_nearest_face_center__doZBuf(void *userData, BMFace *efa, const float screen_co[2], int UNUSED(index))
void MESH_OT_loop_multi_select(wmOperatorType *ot)
BMFace * EDBM_face_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const short selectmode_new)
bool EDBM_selectmode_disable_multi_ex(Scene *scene, struct Base **bases, const uint bases_len, const short selectmode_disable, const short selectmode_fallback)
static void select_linked_delimit_validate(BMesh *bm, int *delimit)
static bool select_linked_delimit_test(BMEdge *e, int delimit, const struct DelimitData *delimit_data)
static int edbm_select_less_exec(bContext *C, wmOperator *op)
bool EDBM_selectmode_toggle_multi(bContext *C, const short selectmode_new, const int action, const bool use_extend, const bool use_expand)
static bool bm_interior_loop_filter_fn(const BMLoop *l, void *UNUSED(user_data))
static int edbm_select_face_by_sides_exec(bContext *C, wmOperator *op)
static int edbm_select_axis_exec(bContext *C, wmOperator *op)
void EDBM_select_mirrored(BMEditMesh *em, const Mesh *me, const int axis, const bool extend, int *r_totmirr, int *r_totfail)
void MESH_OT_select_loose(wmOperatorType *ot)
bool EDBM_deselect_by_material(BMEditMesh *em, const short index, const bool select)
BMEdge * EDBM_edge_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan_p, float *r_dist_center_px_manhattan, const bool use_select_bias, bool use_cycle, BMEdge **r_eed_zbuf, Base **bases, uint bases_len, uint *r_base_index)
void MESH_OT_edgering_select(wmOperatorType *ot)
static bool edbm_select_ungrouped_poll(bContext *C)
static void edbm_select_linked_pick_ex(BMEditMesh *em, BMElem *ele, bool sel, int delimit)
void MESH_OT_select_face_by_sides(wmOperatorType *ot)
BMEdge * EDBM_edge_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
void MESH_OT_select_axis(wmOperatorType *ot)
static bool edbm_deselect_nth(BMEditMesh *em, const struct CheckerIntervalParams *op_params)
static void walker_select(BMEditMesh *em, int walkercode, void *start, const bool select)
void MESH_OT_select_mirror(wmOperatorType *ot)
static void deselect_nth_active(BMEditMesh *em, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
void MESH_OT_edges_select_sharp(wmOperatorType *ot)
static void findnearestface__doClosest(void *userData, BMFace *efa, const float screen_co[2], int index)
static void mouse_mesh_loop_edge(BMEditMesh *em, BMEdge *eed, bool select, bool select_clear, bool select_cycle)
static int select_linked_delimit_default_from_op(wmOperator *op, const int select_mode)
static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
BMVert * EDBM_vert_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan_p, const bool use_select_bias, bool use_cycle, Base **bases, uint bases_len, uint *r_base_index)
static void find_nearest_edge__doClosest(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
static int edbm_select_similar_region_exec(bContext *C, wmOperator *op)
static bool bm_edge_is_select_isolated(BMEdge *e)
void MESH_OT_select_interior_faces(wmOperatorType *ot)
static void find_nearest_edge_center__doZBuf(void *userData, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int UNUSED(index))
void MESH_OT_select_linked(wmOperatorType *ot)
static void select_linked_delimit_begin(BMesh *bm, int delimit)
static int edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool EDBM_mesh_deselect_all_multi(struct bContext *C)
static bool bm_interior_edge_is_manifold_except_face_index(BMEdge *e, int face_index, BMLoop *r_l_pair[2])
static int edbm_select_linked_exec(bContext *C, wmOperator *op)
void MESH_OT_select_all(wmOperatorType *ot)
BMVert * EDBM_vert_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
void MESH_OT_select_more(wmOperatorType *ot)
static int edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
#define FIND_NEAR_CYCLE_THRESHOLD_MIN
bool EDBM_select_interior_faces(BMEditMesh *em)
void MESH_OT_region_to_loop(wmOperatorType *ot)
static void edbm_strip_selections(BMEditMesh *em)
void MESH_OT_loop_select(wmOperatorType *ot)
static int edbm_select_nth_exec(bContext *C, wmOperator *op)
bool EDBM_selectmode_set_multi(bContext *C, const short selectmode)
static int edbm_faces_select_interior_exec(bContext *C, wmOperator *UNUSED(op))
bool EDBM_unified_findnearest(ViewContext *vc, Base **bases, const uint bases_len, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
void MESH_OT_select_ungrouped(wmOperatorType *ot)
bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle)
bool EDBM_selectmode_disable(Scene *scene, BMEditMesh *em, const short selectmode_disable, const short selectmode_fallback)
void MESH_OT_select_non_manifold(wmOperatorType *ot)
BMElem * EDBM_elem_from_selectmode(BMEditMesh *em, BMVert *eve, BMEdge *eed, BMFace *efa)
BMElem * EDBM_elem_from_index_any_multi(ViewLayer *view_layer, int object_index, int elem_index, Object **r_obedit)
int EDBM_elem_to_index_any_multi(ViewLayer *view_layer, BMEditMesh *em, BMElem *ele, int *r_object_index)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
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_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
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_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_mesh_delimit_mode_items[]
const EnumPropertyItem rna_enum_axis_flag_xyz_items[]
const EnumPropertyItem rna_enum_axis_xyz_items[]
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
const EnumPropertyItem rna_enum_transform_orientation_items[]
struct BMEditSelection * next
struct BMLoop * radial_next
const float(* vertexCos)[3]
struct EditMeshData * edit_data
float dist_center_px_manhattan
struct NearestEdgeUserData_Hit hit
struct NearestEdgeUserData_Hit hit_cycle
struct NearestFaceUserData_Hit hit
struct NearestFaceUserData_Hit hit_cycle
struct NearestVertUserData_Hit hit
struct NearestVertUserData_Hit hit_cycle
struct ToolSettings * toolsettings
struct Depsgraph * depsgraph
struct ViewLayer * view_layer
struct RegionView3D * rv3d
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, int depth)
void WM_operator_properties_select_random(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, struct CheckerIntervalParams *op_params)
void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable)