80 *r_totmirr = *r_totfail = 0;
156 *r_totmirr = totmirr;
157 *r_totfail = totfail;
205 #define FIND_NEAR_SELECT_BIAS 5
206 #define FIND_NEAR_CYCLE_THRESHOLD_MIN 3
227 const float screen_co[2],
231 float dist_test, dist_test_bias;
240 data->hit.dist_bias = dist_test_bias;
241 data->hit.dist = dist_test;
242 data->hit.index = index;
243 data->hit.vert = eve;
246 if (
data->use_cycle) {
247 if ((
data->hit_cycle.vert ==
NULL) && (index >
data->cycle_index_prev) &&
249 data->hit_cycle.dist_bias = dist_test_bias;
250 data->hit_cycle.dist = dist_test;
251 data->hit_cycle.index = index;
252 data->hit_cycle.vert = eve;
258 float *dist_px_manhattan_p,
269 *dist_px_manhattan_p);
289 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
291 *r_base_index = base_index;
293 *dist_px_manhattan_p = dist_px_manhattan_test;
315 data.use_select_bias = use_select_bias;
316 data.use_cycle = use_cycle;
318 for (; base_index < bases_len; base_index++) {
319 Base *base_iter = bases[base_index];
321 if (use_cycle && prev_select.bm == vc->
em->
bm &&
323 data.cycle_index_prev = prev_select.index;
328 data.cycle_index_prev = 0;
331 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
332 *dist_px_manhattan_p;
337 hit = (
data.use_cycle &&
data.hit_cycle.vert) ? &
data.hit_cycle : &
data.hit;
339 if (hit->
dist < *dist_px_manhattan_p) {
341 *r_base_index = base_index;
343 *dist_px_manhattan_p = hit->
dist;
344 prev_select_bm = vc->
em->
bm;
352 prev_select.index = hit->
index;
353 prev_select.elem = hit->
vert;
354 prev_select.bm = prev_select_bm;
374 const float screen_co_a[2],
375 const float screen_co_b[2],
380 if (eed ==
data->edge_test) {
382 float screen_co_mid[2];
384 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
387 if (dist_test < data->
dist) {
388 data->dist = dist_test;
417 void *userData,
BMEdge *eed,
const float screen_co_a[2],
const float screen_co_b[2],
int index)
420 float dist_test, dist_test_bias;
429 else if (fac >= 1.0f) {
453 float screen_co_mid[2];
455 data->hit.dist_bias = dist_test_bias;
456 data->hit.dist = dist_test;
457 data->hit.index = index;
458 data->hit.edge = eed;
460 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
464 if (
data->use_cycle) {
465 if ((
data->hit_cycle.edge ==
NULL) && (index >
data->cycle_index_prev) &&
467 float screen_co_mid[2];
469 data->hit_cycle.dist_bias = dist_test_bias;
470 data->hit_cycle.dist = dist_test;
471 data->hit_cycle.index = index;
472 data->hit_cycle.edge = eed;
474 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
481 float *dist_px_manhattan_p,
482 float *r_dist_center_px_manhattan,
494 *dist_px_manhattan_p);
518 if (r_dist_center_px_manhattan && eed) {
524 data.edge_test = eed;
533 *r_dist_center_px_manhattan =
data.dist;
538 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
540 *r_base_index = base_index;
542 *dist_px_manhattan_p = dist_px_manhattan_test;
564 data.use_select_bias = use_select_bias;
565 data.use_cycle = use_cycle;
567 for (; base_index < bases_len; base_index++) {
568 Base *base_iter = bases[base_index];
570 if (use_cycle && prev_select.bm == vc->
em->
bm &&
572 data.cycle_index_prev = prev_select.index;
577 data.cycle_index_prev = 0;
580 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
581 *dist_px_manhattan_p;
587 hit = (
data.use_cycle &&
data.hit_cycle.edge) ? &
data.hit_cycle : &
data.hit;
589 if (hit->
dist < *dist_px_manhattan_p) {
591 *r_base_index = base_index;
593 *dist_px_manhattan_p = hit->
dist;
594 prev_select_bm = vc->
em->
bm;
602 if (r_dist_center_px_manhattan) {
606 prev_select.index = hit->
index;
607 prev_select.elem = hit->
edge;
608 prev_select.bm = prev_select_bm;
617 vc, dist_px_manhattan_p,
NULL,
false,
false,
NULL, &base, 1,
NULL);
629 const float screen_co[2],
634 if (efa ==
data->face_test) {
638 data->dist_px_manhattan = dist_test;
662 const float screen_co[2],
666 float dist_test, dist_test_bias;
675 data->hit.dist_bias = dist_test_bias;
676 data->hit.dist = dist_test;
677 data->hit.index = index;
678 data->hit.face = efa;
681 if (
data->use_cycle) {
682 if ((
data->hit_cycle.face ==
NULL) && (index >
data->cycle_index_prev) &&
684 data->hit_cycle.dist_bias = dist_test_bias;
685 data->hit_cycle.dist = dist_test;
686 data->hit_cycle.index = index;
687 data->hit_cycle.face = efa;
693 float *dist_px_manhattan_p,
694 float *r_dist_center,
695 const bool use_zbuf_single_px,
711 uint dist_px_manhattan_test = 0;
712 if (*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px ==
false)) {
714 *dist_px_manhattan_p);
719 if (dist_px_manhattan_test == 0) {
726 dist_test = dist_px_manhattan_test;
742 if (r_dist_center && efa) {
747 data.dist_px_manhattan = FLT_MAX;
748 data.face_test = efa;
755 *r_dist_center =
data.dist_px_manhattan;
760 if (dist_test < *dist_px_manhattan_p) {
762 *r_base_index = base_index;
764 *dist_px_manhattan_p = dist_test;
784 data.use_select_bias = use_select_bias;
785 data.use_cycle = use_cycle;
787 for (; base_index < bases_len; base_index++) {
788 Base *base_iter = bases[base_index];
790 if (use_cycle && prev_select.bm == vc->
em->
bm &&
792 data.cycle_index_prev = prev_select.index;
797 data.cycle_index_prev = 0;
800 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
801 *dist_px_manhattan_p;
806 hit = (
data.use_cycle &&
data.hit_cycle.face) ? &
data.hit_cycle : &
data.hit;
808 if (hit->
dist < *dist_px_manhattan_p) {
810 *r_base_index = base_index;
812 *dist_px_manhattan_p = hit->
dist;
813 prev_select_bm = vc->
em->
bm;
822 *r_dist_center = hit->
dist;
825 prev_select.index = hit->
index;
826 prev_select.elem = hit->
face;
827 prev_select.bm = prev_select_bm;
836 vc, dist_px_manhattan_p,
NULL,
false,
false,
false,
NULL, &base, 1,
NULL);
839 #undef FIND_NEAR_SELECT_BIAS
840 #undef FIND_NEAR_CYCLE_THRESHOLD_MIN
849 const uint bases_len,
860 const float dist_margin = (dist_init / 2);
861 float dist = dist_init;
881 float dist_center = 0.0f;
889 vc, &dist, dist_center_p,
true,
true, use_cycle, &efa_zbuf, bases, bases_len, &base_index);
891 if (efa_test && dist_center_p) {
892 dist =
min_ff(dist_margin, dist_center);
895 hit.f.base_index = base_index;
896 hit.f.ele = efa_test;
899 hit.f_zbuf.base_index = base_index;
900 hit.f_zbuf.ele = efa_zbuf;
905 float dist_center = 0.0f;
911 vc, &dist, dist_center_p,
true, use_cycle, &eed_zbuf, bases, bases_len, &base_index);
913 if (eed_test && dist_center_p) {
914 dist =
min_ff(dist_margin, dist_center);
917 hit.e.base_index = base_index;
918 hit.e.ele = eed_test;
921 hit.e_zbuf.base_index = base_index;
922 hit.e_zbuf.ele = eed_zbuf;
929 vc, &dist,
true, use_cycle, bases, bases_len, &base_index);
932 hit.v.base_index = base_index;
933 hit.v.ele = eve_test;
942 else if (hit.e.ele) {
948 if ((hit.v.ele || hit.e.ele || hit.f.ele) == 0) {
949 if (hit.e_zbuf.ele) {
950 hit.e.base_index = hit.e_zbuf.base_index;
951 hit.e.ele = hit.e_zbuf.ele;
953 else if (hit.f_zbuf.ele) {
954 hit.f.base_index = hit.f_zbuf.base_index;
955 hit.f.ele = hit.f_zbuf.ele;
963 *r_base_index = hit.v.base_index;
966 *r_base_index = hit.e.base_index;
969 *r_base_index = hit.f.base_index;
976 return (hit.v.ele || hit.e.ele || hit.f.ele);
979 #undef FAKE_SELECT_MODE_BEGIN
980 #undef FAKE_SELECT_MODE_END
984 const uint bases_len,
1004 const uint bases_len,
1005 bool use_boundary_vertices,
1006 bool use_boundary_edges,
1007 int *r_base_index_vert,
1008 int *r_base_index_edge,
1009 int *r_base_index_face,
1016 float ray_origin[3], ray_direction[3];
1028 } best_vert = {0,
NULL};
1033 } best_edge = {0,
NULL};
1038 } best_face = {0,
NULL};
1042 float dist_sq_best = FLT_MAX;
1043 float dist_sq_best_vert = FLT_MAX;
1044 float dist_sq_best_edge = FLT_MAX;
1045 float dist_sq_best_face = FLT_MAX;
1047 const bool use_vert = (r_eve !=
NULL);
1048 const bool use_edge = (r_eed !=
NULL);
1049 const bool use_face = (r_efa !=
NULL);
1051 for (
uint base_index = 0; base_index < bases_len; base_index++) {
1052 Base *base_iter = bases[base_index];
1071 if (coords !=
NULL) {
1075 if ((use_boundary_vertices || use_boundary_edges) && (use_vert || use_edge)) {
1080 if (use_vert && use_boundary_vertices) {
1081 for (
uint j = 0; j < 2; j++) {
1086 ray_origin, ray_direction,
point);
1087 if (dist_sq_test < dist_sq_best_vert) {
1088 dist_sq_best_vert = dist_sq_test;
1089 best_vert.base_index = base_index;
1092 if (dist_sq_test < dist_sq_best) {
1093 dist_sq_best = dist_sq_test;
1094 best.base_index = base_index;
1100 if (use_edge && use_boundary_edges) {
1104 ray_origin, ray_direction,
e->v1->
co,
e->v2->
co,
point, &depth);
1115 ray_origin, ray_direction,
point);
1116 if (dist_sq_test < dist_sq_best_edge) {
1117 dist_sq_best_edge = dist_sq_test;
1118 best_edge.base_index = base_index;
1121 if (dist_sq_test < dist_sq_best) {
1122 dist_sq_best = dist_sq_test;
1123 best.base_index = base_index;
1132 if (use_vert && !use_boundary_vertices) {
1140 ray_origin, ray_direction,
point);
1141 if (dist_sq_test < dist_sq_best_vert) {
1142 dist_sq_best_vert = dist_sq_test;
1143 best_vert.base_index = base_index;
1146 if (dist_sq_test < dist_sq_best) {
1147 dist_sq_best = dist_sq_test;
1148 best.base_index = base_index;
1155 if (use_edge && !use_boundary_edges) {
1170 ray_origin, ray_direction,
point);
1171 if (dist_sq_test < dist_sq_best_edge) {
1172 dist_sq_best_edge = dist_sq_test;
1173 best_edge.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;
1199 ray_origin, ray_direction,
point);
1200 if (dist_sq_test < dist_sq_best_face) {
1201 dist_sq_best_face = dist_sq_test;
1202 best_face.base_index = base_index;
1203 best_face.ele = (
BMElem *)f;
1205 if (dist_sq_test < dist_sq_best) {
1206 dist_sq_best = dist_sq_test;
1207 best.base_index = base_index;
1216 *r_base_index_vert = best_vert.base_index;
1217 *r_base_index_edge = best_edge.base_index;
1218 *r_base_index_face = best_face.base_index;
1230 if (best_vert.ele) {
1231 *r_eve = (
BMVert *)best_vert.ele;
1233 if (best_edge.ele) {
1234 *r_eed = (
BMEdge *)best_edge.ele;
1236 if (best_face.ele) {
1237 *r_efa = (
BMFace *)best_face.ele;
1240 return (best_vert.ele !=
NULL || best_edge.ele !=
NULL || best_face.ele !=
NULL);
1254 bool changed =
false;
1258 int(*group_index)[2];
1273 for (i = 0; i < group_tot; i++) {
1277 const int fg_sta = group_index[i][0];
1278 const int fg_len = group_index[i][1];
1282 for (j = 0; j < fg_len; j++) {
1294 while ((f = *(
faces++))) {
1322 ot->
name =
"Select Similar Regions";
1323 ot->
idname =
"MESH_OT_select_similar_region";
1324 ot->
description =
"Select similar face regions to the current selection";
1396 "Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection"));
1399 TIP_(
"Edge select - Shift-Click for multiple modes, "
1400 "Ctrl-Click expands/contracts selection depending on the current mode"));
1403 TIP_(
"Face select - Shift-Click for multiple modes, Ctrl-Click expands selection"));
1415 {0,
"DISABLE", 0,
"Disable",
"Disable selected markers"},
1416 {1,
"ENABLE", 0,
"Enable",
"Enable selected markers"},
1417 {2,
"TOGGLE", 0,
"Toggle",
"Toggle disabled flag for selected markers"},
1422 ot->
name =
"Select Mode";
1423 ot->
idname =
"MESH_OT_select_mode";
1445 ot->
srna,
"action", actions_items, 2,
"Action",
"Selection action to execute");
1458 int r_count_by_select[2])
1464 r_count_by_select[0] = r_count_by_select[1] = 0;
1479 if (r_count_by_select[0] && r_count_by_select[1]) {
1480 r_count_by_select[0] = r_count_by_select[1] = -1;
1516 uint objects_len = 0;
1519 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1520 Object *obedit = objects[ob_index];
1544 edarray[edindex] = eed;
1550 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1551 eed = edarray[edindex];
1557 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1558 eed = edarray[edindex];
1583 ot->
name =
"Multi Select Loops";
1584 ot->
idname =
"MESH_OT_loop_multi_select";
1585 ot->
description =
"Select a loop of connected edges by connection type";
1625 bool edge_boundary =
false;
1630 int count_by_select[2];
1634 if (count_by_select[!
select] == 0) {
1635 edge_boundary =
true;
1639 if (count_by_select[!
select] == 0) {
1640 edge_boundary =
false;
1649 if (edge_boundary) {
1652 else if (non_manifold) {
1661 bContext *
C,
const int mval[2],
bool extend,
bool deselect,
bool toggle,
bool ring)
1671 bool select_clear =
false;
1672 bool select_cycle =
true;
1676 mvalf[0] = (
float)(vc.
mval[0] = mval[0]);
1677 mvalf[1] = (
float)(vc.
mval[1] = mval[1]);
1680 const short selectmode = em_original->
selectmode;
1687 int base_index = -1;
1689 basact = bases[base_index];
1705 if (extend ==
false && deselect ==
false && toggle ==
false) {
1706 select_clear =
true;
1712 else if (deselect) {
1720 select_cycle =
false;
1724 for (
uint base_index = 0; base_index < bases_len; base_index++) {
1725 Base *base_iter = bases[base_index];
1733 if (em_iter == em) {
1761 float v1_co[2], v2_co[2];
1762 float length_1 = FLT_MAX;
1763 float length_2 = FLT_MAX;
1778 printf(
"mouse to v1: %f\nmouse to v2: %f\n",
1791 float best_dist = FLT_MAX;
1806 if (tdist < best_dist) {
1848 ot->
name =
"Loop Select";
1849 ot->
idname =
"MESH_OT_loop_select";
1875 ot->
name =
"Edge Ring Select";
1876 ot->
idname =
"MESH_OT_edgering_select";
1909 uint objects_len = 0;
1915 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1916 Object *obedit = objects[ob_index];
1925 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1926 Object *obedit = objects[ob_index];
1952 ot->
name =
"(De)select All";
1954 ot->
description =
"(De)select all vertices, edges or faces";
1975 uint objects_len = 0;
1979 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
1980 Object *obedit = objects[ob_index];
1998 ot->
name =
"Select Interior Faces";
1999 ot->
idname =
"MESH_OT_select_interior_faces";
2000 ot->
description =
"Select faces where all edges have more than 2 face users";
2023 int base_index_active = -1;
2030 vc.
mval[0] = mval[0];
2031 vc.
mval[1] = mval[1];
2036 bool changed =
false;
2037 bool found =
unified_findnearest(&vc, bases, bases_len, &base_index_active, &eve, &eed, &efa);
2044 else if (found ||
params->deselect_all) {
2046 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2047 Base *base_iter = bases[base_index];
2058 Base *basact = bases[base_index_active];
2062 switch (
params->sel_op) {
2107 switch (
params->sel_op) {
2147 switch (
params->sel_op) {
2200 if (cd_fmap_offset != -1) {
2245 nextese = ese->
next;
2255 nextese = ese->
next;
2265 nextese = ese->
next;
2329 const short selectmode_old,
2330 const short selectmode_new)
2435 const short selectmode_new,
2437 const bool use_extend,
2438 const bool use_expand)
2455 bool only_update =
false;
2462 if ((em->
selectmode & selectmode_new) == 0) {
2470 if ((em->
selectmode & selectmode_new) != 0) {
2489 uint objects_len = 0;
2493 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2494 Object *ob_iter = objects[ob_index];
2496 if (em_iter != em) {
2506 if (use_extend == 0 || em->
selectmode == 0) {
2509 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2510 Object *ob_iter = objects[ob_index];
2517 switch (selectmode_new) {
2519 if (use_extend == 0 || em->
selectmode == 0) {
2525 if (use_extend == 0 || em->
selectmode == 0) {
2531 if (use_extend == 0 || em->
selectmode == 0) {
2544 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2545 Object *ob_iter = objects[ob_index];
2563 bool changed =
false;
2585 uint objects_len = 0;
2589 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
2590 Object *ob_iter = objects[ob_index];
2611 const short selectmode_disable,
2612 const short selectmode_fallback)
2643 bool changed =
false;
2649 if (efa->
mat_nr == index) {
2702 bool changed_multi =
false;
2703 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2704 Base *base_iter = bases[base_index];
2714 changed_multi =
true;
2716 return changed_multi;
2729 return changed_multi;
2733 struct Base **bases,
2734 const uint bases_len,
2735 const short selectmode_disable,
2736 const short selectmode_fallback)
2738 bool changed_multi =
false;
2739 for (
uint base_index = 0; base_index < bases_len; base_index++) {
2740 Base *base_iter = bases[base_index];
2745 changed_multi =
true;
2748 return changed_multi;
2752 const short selectmode_disable,
2753 const short selectmode_fallback)
2763 scene, bases, bases_len, selectmode_disable, selectmode_fallback);
2765 return changed_multi;
2805 if (!
ELEM(i, -1, face_index)) {
2806 if (loop_index == 2) {
2809 r_l_pair[loop_index++] = l_iter;
2812 return (loop_index == 2);
2827 BMFace *f = f_link->face;
2828 area += f_link->area;
2831 BMLoop *l_iter, *l_first;
2835 float cost_test = 0.0f;
2838 BMLoop *l_radial_iter = l_iter;
2841 if (!
ELEM(i_other, -1, i)) {
2857 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
2859 if (cost_count >= 2) {
2864 }
while ((l_iter = l_iter->
next) != l_first);
2866 return found ? cost /
area : FLT_MAX;
2873 bool changed =
false;
2878 bool has_nonmanifold =
false;
2885 has_nonmanifold =
true;
2890 edge_lengths[i] = -1.0;
2897 if (has_nonmanifold ==
false) {
2905 int(*fgroup_index)[2];
2912 int *fgroup_recalc_stack =
MEM_mallocN(
sizeof(*fgroup_recalc_stack) * fgroup_len, __func__);
2929 for (
int i = 0; i < fgroup_len; i++) {
2930 const int fg_sta = fgroup_index[i][0];
2931 const int fg_len = fgroup_index[i][1];
2932 for (
int j = 0; j < fg_len; j++) {
2933 const int face_index = fgroup_array[fg_sta + j];
2937 struct BMFaceLink *f_link = &f_link_array[face_index];
2949 bool *fgroup_dirty =
MEM_callocN(
sizeof(*fgroup_dirty) * fgroup_len, __func__);
2951 for (
int i = 0; i < fgroup_len; i++) {
2953 if (cost != FLT_MAX) {
2957 fgroup_table[i] =
NULL;
2969 #define USE_DELAY_FACE_GROUP_COST_CALC
2973 #if defined(USE_DELAY_FACE_GROUP_COST_CALC)
2977 if (fgroup_dirty[i]) {
2979 if (cost != FLT_MAX) {
2987 fgroup_table[i] =
NULL;
2989 fgroup_dirty[i] =
false;
3004 fgroup_table[i_min] =
NULL;
3008 while ((f_link =
BLI_pophead(&fgroup_listbase[i_min]))) {
3013 BMLoop *l_iter, *l_first;
3029 SWAP(
int, i_a, i_b);
3034 BMFace *f_iter = n->data;
3042 fgroup_table[i_b] =
NULL;
3047 if (fgroup_dirty[i_a] ==
false) {
3050 fgroup_dirty[i_a] =
true;
3057 if (l_radial_iter != l_iter) {
3060 if (!
ELEM(i_other, -1, i_min)) {
3061 if ((fgroup_table[i_other] !=
NULL) && (fgroup_dirty[i_other] ==
false)) {
3062 #if !defined(USE_DELAY_FACE_GROUP_COST_CALC)
3065 fgroup_dirty[i_other] =
true;
3068 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
3071 }
while ((l_iter = l_iter->
next) != l_first);
3074 for (
int index = 0; index <
STACK_SIZE(fgroup_recalc_stack); index++) {
3075 const int i = fgroup_recalc_stack[index];
3076 if (fgroup_table[i] !=
NULL && fgroup_dirty[i] ==
true) {
3079 if (cost != FLT_MAX) {
3084 fgroup_table[i] =
NULL;
3087 fgroup_dirty[i] =
false;
3113 #define USE_LINKED_SELECT_DEFAULT_HACK
3145 if (
e->l &&
e->l->radial_next !=
e->l) {
3146 const short mat_nr =
e->l->f->mat_nr;
3147 BMLoop *l_iter =
e->l->radial_next;
3149 if (l_iter->
f->
mat_nr != mat_nr) {
3166 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3175 char *delimit_last = &delimit_last_store[delimit_last_index];
3181 *delimit_last = delimit;
3184 delimit = *delimit_last;
3239 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3246 uint objects_len = 0;
3250 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3251 Object *obedit = objects[ob_index];
3258 int delimit = delimit_init;
3447 ot->
name =
"Select Linked All";
3448 ot->
idname =
"MESH_OT_select_linked";
3449 ot->
description =
"Select all vertices connected to the current selection";
3463 "Delimit selected region");
3464 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3506 BMW_ITER (ele_walk, &walker, eve) {
3543 BMW_ITER (ele_walk, &walker, eed) {
3618 bool has_edges =
false;
3619 for (
uint base_index = 0; base_index < bases_len; base_index++) {
3626 if (has_edges ==
false) {
3632 vc.
mval[0] =
event->mval[0];
3633 vc.
mval[1] =
event->mval[1];
3637 int base_index = -1;
3638 const bool ok =
unified_findnearest(&vc, bases, bases_len, &base_index, &eve, &eed, &efa);
3643 basact = bases[base_index];
3650 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3699 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3718 ot->
name =
"Select Linked";
3719 ot->
idname =
"MESH_OT_select_linked_pick";
3720 ot->
description =
"(De)select all vertices linked to the edge under the mouse cursor";
3736 "Delimit selected region");
3737 #ifdef USE_LINKED_SELECT_DEFAULT_HACK
3742 prop =
RNA_def_int(
ot->
srna,
"object_index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
3757 uint objects_len = 0;
3764 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3765 Object *obedit = objects[ob_index];
3814 {0,
"LESS", 0,
"Less Than",
""},
3815 {1,
"EQUAL", 0,
"Equal To",
""},
3816 {2,
"GREATER", 0,
"Greater Than",
""},
3817 {3,
"NOTEQUAL", 0,
"Not Equal To",
""},
3822 ot->
name =
"Select Faces by Sides";
3823 ot->
description =
"Select vertices or faces by the number of polygon sides";
3824 ot->
idname =
"MESH_OT_select_face_by_sides";
3834 RNA_def_int(
ot->
srna,
"number", 4, 3, INT_MAX,
"Number of Vertices",
"", 3, INT_MAX);
3850 uint objects_len = 0;
3854 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3855 Object *obedit = objects[ob_index];
3887 bool is_loose =
true;
3914 ot->
name =
"Select Loose Geometry";
3915 ot->
description =
"Select loose geometry based on the selection mode";
3916 ot->
idname =
"MESH_OT_select_loose";
3943 int tot_mirr = 0, tot_fail = 0;
3945 uint objects_len = 0;
3949 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
3950 Object *obedit = objects[ob_index];
3957 int tot_mirr_iter = 0, tot_fail_iter = 0;
3959 for (
int axis = 0; axis < 3; axis++) {
3960 if ((1 << axis) & axis_flag) {
3965 if (tot_mirr_iter) {
3972 tot_fail += tot_fail_iter;
3973 tot_mirr += tot_mirr_iter;
3977 if (tot_mirr || tot_fail) {
3986 ot->
name =
"Select Mirror";
3987 ot->
description =
"Select mesh items at mirrored locations";
3988 ot->
idname =
"MESH_OT_select_mirror";
4014 uint objects_len = 0;
4017 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4018 Object *obedit = objects[ob_index];
4038 ot->
name =
"Select More";
4039 ot->
idname =
"MESH_OT_select_more";
4040 ot->
description =
"Select more vertices, edges or faces connected to initial selection";
4050 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4064 uint objects_len = 0;
4067 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4068 Object *obedit = objects[ob_index];
4088 ot->
name =
"Select Less";
4089 ot->
idname =
"MESH_OT_select_less";
4090 ot->
description =
"Deselect vertices, edges or faces at the boundary of each selection region";
4100 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4141 int walktype = 0, itertype = 0, flushtype = 0;
4142 short mask_vert = 0, mask_edge = 0, mask_face = 0;
4145 if (h_act ==
NULL) {
4151 switch (h_act->
htype) {
4302 bool found_active_elt =
false;
4304 uint objects_len = 0;
4308 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4309 Object *obedit = objects[ob_index];
4317 found_active_elt =
true;
4320 .calc_looptri = false,
4321 .calc_normals = false,
4322 .is_destructive = false,
4328 if (!found_active_elt) {
4339 ot->
name =
"Checker Deselect";
4341 ot->
description =
"Deselect every Nth element starting from the active vertex, edge or face";
4378 uint objects_len = 0;
4382 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4383 Object *obedit = objects[ob_index];
4394 if (angle_cos < angle_limit_cos) {
4420 ot->
name =
"Select Sharp Edges";
4422 ot->
idname =
"MESH_OT_edges_select_sharp";
4454 uint objects_len = 0;
4459 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4460 Object *obedit = objects[ob_index];
4470 BMIter iter, liter, liter2;
4503 if (angle_cos > angle_limit_cos) {
4526 ot->
name =
"Select Linked Flat Faces";
4528 ot->
idname =
"MESH_OT_faces_select_linked_flat";
4567 uint objects_len = 0;
4571 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4572 Object *obedit = objects[ob_index];
4602 if (use_wire || use_boundary || use_multi_face || use_non_contiguous) {
4630 ot->
name =
"Select Non-Manifold";
4631 ot->
description =
"Select all non-manifold vertices or edges";
4632 ot->
idname =
"MESH_OT_select_non_manifold";
4647 ot->
srna,
"use_multi_face",
true,
"Multiple Faces",
"Edges shared by more than two faces");
4649 "use_non_contiguous",
4652 "Edges between faces pointing in alternate directions");
4655 ot->
srna,
"use_verts",
true,
"Vertices",
"Vertices connecting multiple face regions");
4672 uint objects_len = 0;
4675 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4676 Object *obedit = objects[ob_index];
4679 int seed_iter =
seed;
4687 int elem_map_len = 0;
4692 elem_map[elem_map_len++] = eve;
4697 const int count_select = elem_map_len * randfac;
4698 for (
int i = 0; i < count_select; i++) {
4704 int elem_map_len = 0;
4709 elem_map[elem_map_len++] = eed;
4713 const int count_select = elem_map_len * randfac;
4714 for (
int i = 0; i < count_select; i++) {
4720 int elem_map_len = 0;
4725 elem_map[elem_map_len++] = efa;
4729 const int count_select = elem_map_len * randfac;
4730 for (
int i = 0; i < count_select; i++) {
4755 ot->
name =
"Select Random";
4757 ot->
idname =
"MESH_OT_select_random";
4802 uint objects_len = 0;
4806 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4807 Object *obedit = objects[ob_index];
4812 if (cd_dvert_offset == -1) {
4819 bool changed =
false;
4852 ot->
name =
"Select Ungrouped";
4853 ot->
idname =
"MESH_OT_select_ungrouped";
4889 if (v_act ==
NULL) {
4891 op->
reports,
RPT_WARNING,
"This operator requires an active vertex (last selected)");
4898 float axis_mat[3][3];
4911 const float *axis_vector = axis_mat[axis];
4914 float vertex_world[3];
4916 value =
dot_v3v3(axis_vector, vertex_world);
4926 uint objects_len = 0;
4929 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
4930 Object *obedit_iter = objects[ob_index];
4940 bool changed =
false;
4944 float v_iter_world[3];
4946 const float value_iter =
dot_v3v3(axis_vector, v_iter_world);
4949 if (
fabsf(value_iter - value) < limit) {
4955 if (value_iter < value) {
4961 if (value_iter > value) {
4989 ot->
name =
"Select Axis";
4990 ot->
description =
"Select all data in the mesh on a single axis";
4991 ot->
idname =
"MESH_OT_select_axis";
5006 "Axis orientation");
5013 "Select the axis to compare each vertex on");
5015 ot->
srna,
"threshold", 0.0001f, 0.000001f, 50.0f,
"Threshold",
"", 0.00001f, 10.0f);
5027 uint objects_len = 0;
5030 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
5031 Object *obedit = objects[ob_index];
5048 int tot = 0, totsel = 0;
5055 if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1)) {
5088 ot->
name =
"Select Boundary Loop";
5089 ot->
idname =
"MESH_OT_region_to_loop";
5090 ot->
description =
"Select boundary edges around the selected faces";
5145 *region_out = region;
5174 GSet *visit_face_set;
5181 edges =
MEM_mallocN(
sizeof(*edges) * edges_len, __func__);
5195 qsort(edges, edges_len,
sizeof(*edges),
verg_radial);
5197 for (i = 0; i < edges_len; i++) {
5216 if (!region || (selbigger ?
c >= tot :
c < tot)) {
5224 region = region_out;
5235 for (j = 0; j < tot; j++) {
5259 uint objects_len = 0;
5262 for (
uint ob_index = 0; ob_index < objects_len; ob_index++) {
5263 Object *obedit = objects[ob_index];
5302 ot->
name =
"Select Loop Inner-Region";
5303 ot->
idname =
"MESH_OT_loop_to_region";
5304 ot->
description =
"Select region of faces inside of a selected loop of edges";
5317 "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)
CustomData interface, see also DNA_customdata_types.h.
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, eReportType 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)
#define BLI_assert_unreachable()
bool BLI_gset_haskey(const GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
void BLI_gset_insert(GSet *gs, void *key)
GSet * BLI_gset_ptr_new_ex(const char *info, 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)
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)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
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)
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
int BLI_listbase_count_at_most(const struct ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT 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])
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
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 interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
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_num, unsigned int seed)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
#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_SIZE(stack)
#define STACK_INIT(stack, stack_num)
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)
uint DRW_select_buffer_find_nearest_to_point(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int center[2], uint id_min, uint id_max, uint *dist)
void DRW_select_buffer_context_create(struct Base **bases, uint bases_len, short select_mode)
bool DRW_select_buffer_elem_get(uint sel_id, uint *r_elem, uint *r_base_index, char *r_elem_type)
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_update(struct Mesh *me, const struct EDBMUpdate_Params *params)
struct BMFace * EDBM_verts_mirror_get_face(struct BMEditMesh *em, struct BMFace *f)
void EDBM_flag_enable_all(struct BMEditMesh *em, char hflag)
void EDBM_select_flush(struct BMEditMesh *em)
struct BMVert * EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v)
void EDBM_verts_mirror_cache_end(struct BMEditMesh *em)
void EDBM_select_more(struct BMEditMesh *em, bool use_face_step)
void EDBM_flag_disable_all(struct BMEditMesh *em, char hflag)
void EDBM_deselect_flush(struct BMEditMesh *em)
void EDBM_select_less(struct BMEditMesh *em, bool use_face_step)
void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
void EDBM_selectmode_flush_ex(struct BMEditMesh *em, short selectmode)
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_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)
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT
@ V3D_PROJ_TEST_CLIP_NEAR
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
void mesh_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index), void *userData, eV3DProjTest clip_flag)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], bool is_local)
bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
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, eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
#define XRAY_FLAG_ENABLED(v3d)
void view3d_operator_needs_opengl(const struct bContext *C)
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, float dist)
float ED_view3d_select_dist_px(void)
void mesh_foreachScreenFace(struct ViewContext *vc, void(*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index), void *userData, eV3DProjTest clip_flag)
_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.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
#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)
BMESH OPSTACK PUSH.
#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)
bool EDBM_select_pick(bContext *C, const int mval[2], const struct SelectPick_Params *params)
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)
static char * edbm_select_mode_get_description(struct bContext *UNUSED(C), struct wmOperatorType *UNUSED(op), struct PointerRNA *values)
void MESH_OT_select_ungrouped(wmOperatorType *ot)
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, uint object_index, uint 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])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
SocketIndexByIdentifierMap * map
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
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
bool WM_cursor_test_motion_and_update(const int mval[2])
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)