111 {0,
nullptr, 0,
nullptr,
nullptr},
115 const int value_test,
116 const int value_reference)
120 return (value_test < value_reference);
122 return (value_test == value_reference);
124 return (value_test > value_reference);
126 return (value_test != value_reference);
152 *r_totmirr = *r_totfail = 0;
240 *r_totmirr = totmirr;
241 *r_totfail = totfail;
259 Object *obedit = bases[r_base_index]->object;
291#define FIND_NEAR_SELECT_BIAS 5
292#define FIND_NEAR_CYCLE_THRESHOLD_MIN 3
313 const float screen_co[2],
317 float dist_test, dist_test_bias;
325 if (dist_test_bias < data->hit.dist_bias) {
326 data->hit.dist_bias = dist_test_bias;
327 data->hit.dist = dist_test;
328 data->hit.index = index;
329 data->hit.vert = eve;
332 if (
data->use_cycle) {
333 if ((
data->hit_cycle.vert ==
nullptr) && (index >
data->cycle_index_prev) &&
336 data->hit_cycle.dist_bias = dist_test_bias;
337 data->hit_cycle.dist = dist_test;
338 data->hit_cycle.index = index;
339 data->hit_cycle.vert = eve;
345 float *dist_px_manhattan_p,
346 const bool use_select_bias,
375 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
377 *r_base_index = base_index;
379 *dist_px_manhattan_p = dist_px_manhattan_test;
391 BMesh *prev_select_bm =
nullptr;
401 data.use_select_bias = use_select_bias;
402 data.use_cycle = use_cycle;
404 for (; base_index < bases.
size(); base_index++) {
405 Base *base_iter = bases[base_index];
407 if (use_cycle && prev_select.bm == vc->
em->
bm &&
410 data.cycle_index_prev = prev_select.index;
415 data.cycle_index_prev = 0;
418 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
419 *dist_px_manhattan_p;
424 hit = (
data.use_cycle &&
data.hit_cycle.vert) ? &
data.hit_cycle : &
data.hit;
426 if (hit->
dist < *dist_px_manhattan_p) {
428 *r_base_index = base_index;
430 *dist_px_manhattan_p = hit->
dist;
431 prev_select_bm = vc->
em->
bm;
435 if (hit ==
nullptr) {
439 prev_select.index = hit->
index;
440 prev_select.elem = hit->
vert;
441 prev_select.bm = prev_select_bm;
462 const float screen_co_a[2],
463 const float screen_co_b[2],
468 if (eed ==
data->edge_test) {
470 float screen_co_mid[2];
472 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
475 data->dist = std::min(dist_test,
data->dist);
506 const float screen_co_a[2],
507 const float screen_co_b[2],
511 float dist_test, dist_test_bias;
520 else if (fac >= 1.0f) {
543 if (dist_test_bias < data->hit.dist_bias) {
544 float screen_co_mid[2];
546 data->hit.dist_bias = dist_test_bias;
547 data->hit.dist = dist_test;
548 data->hit.index = index;
549 data->hit.edge = eed;
551 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
555 if (
data->use_cycle) {
556 if ((
data->hit_cycle.edge ==
nullptr) && (index >
data->cycle_index_prev) &&
559 float screen_co_mid[2];
561 data->hit_cycle.dist_bias = dist_test_bias;
562 data->hit_cycle.dist = dist_test;
563 data->hit_cycle.index = index;
564 data->hit_cycle.edge = eed;
566 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
573 float *dist_px_manhattan_p,
574 float *r_dist_center_px_manhattan,
575 const bool use_select_bias,
609 if (r_dist_center_px_manhattan && eed) {
615 data.edge_test = eed;
624 *r_dist_center_px_manhattan =
data.dist;
629 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
631 *r_base_index = base_index;
633 *dist_px_manhattan_p = dist_px_manhattan_test;
644 BMesh *prev_select_bm =
nullptr;
655 data.use_select_bias = use_select_bias;
656 data.use_cycle = use_cycle;
658 for (; base_index < bases.
size(); base_index++) {
659 Base *base_iter = bases[base_index];
661 if (use_cycle && prev_select.bm == vc->
em->
bm &&
664 data.cycle_index_prev = prev_select.index;
669 data.cycle_index_prev = 0;
672 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
673 *dist_px_manhattan_p;
679 hit = (
data.use_cycle &&
data.hit_cycle.edge) ? &
data.hit_cycle : &
data.hit;
681 if (hit->
dist < *dist_px_manhattan_p) {
683 *r_base_index = base_index;
685 *dist_px_manhattan_p = hit->
dist;
686 prev_select_bm = vc->
em->
bm;
690 if (hit ==
nullptr) {
694 if (r_dist_center_px_manhattan) {
698 prev_select.index = hit->
index;
699 prev_select.elem = hit->
edge;
700 prev_select.bm = prev_select_bm;
710 vc, dist_px_manhattan_p,
nullptr,
false,
false,
nullptr, {base},
nullptr);
722 const float screen_co[2],
727 if (efa ==
data->face_test) {
730 data->dist_px_manhattan = std::min(dist_test,
data->dist_px_manhattan);
753 const float screen_co[2],
757 float dist_test, dist_test_bias;
765 if (dist_test_bias < data->hit.dist_bias) {
766 data->hit.dist_bias = dist_test_bias;
767 data->hit.dist = dist_test;
768 data->hit.index = index;
769 data->hit.face = efa;
772 if (
data->use_cycle) {
773 if ((
data->hit_cycle.face ==
nullptr) && (index >
data->cycle_index_prev) &&
776 data->hit_cycle.dist_bias = dist_test_bias;
777 data->hit_cycle.dist = dist_test;
778 data->hit_cycle.index = index;
779 data->hit_cycle.face = efa;
785 float *dist_px_manhattan_p,
786 float *r_dist_center,
787 const bool use_zbuf_single_px,
788 const bool use_select_bias,
802 uint dist_px_manhattan_test = 0;
803 if (*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px ==
false)) {
804 dist_px_manhattan_test =
uint(
810 if (dist_px_manhattan_test == 0) {
817 dist_test = dist_px_manhattan_test;
833 if (r_dist_center && efa) {
839 data.face_test = efa;
846 *r_dist_center =
data.dist_px_manhattan;
851 if (dist_test < *dist_px_manhattan_p) {
853 *r_base_index = base_index;
855 *dist_px_manhattan_p = dist_test;
865 BMesh *prev_select_bm =
nullptr;
875 data.use_select_bias = use_select_bias;
876 data.use_cycle = use_cycle;
878 for (; base_index < bases.
size(); base_index++) {
879 Base *base_iter = bases[base_index];
881 if (use_cycle && prev_select.bm == vc->
em->
bm &&
884 data.cycle_index_prev = prev_select.index;
889 data.cycle_index_prev = 0;
892 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
893 *dist_px_manhattan_p;
898 hit = (
data.use_cycle &&
data.hit_cycle.face) ? &
data.hit_cycle : &
data.hit;
900 if (hit->
dist < *dist_px_manhattan_p) {
902 *r_base_index = base_index;
904 *dist_px_manhattan_p = hit->
dist;
905 prev_select_bm = vc->
em->
bm;
909 if (hit ==
nullptr) {
914 *r_dist_center = hit->
dist;
917 prev_select.index = hit->
index;
918 prev_select.elem = hit->
face;
919 prev_select.bm = prev_select_bm;
929 vc, dist_px_manhattan_p,
nullptr,
false,
false,
false,
nullptr, {base},
nullptr);
932#undef FIND_NEAR_SELECT_BIAS
933#undef FIND_NEAR_CYCLE_THRESHOLD_MIN
953 const float dist_margin = (dist_init / 2);
954 float dist = dist_init;
974 float dist_center = 0.0f;
980 BMFace *efa_zbuf =
nullptr;
982 vc, &dist, dist_center_p,
true,
true, use_cycle, &efa_zbuf, bases, &base_index);
984 if (efa_test && dist_center_p) {
985 dist =
min_ff(dist_margin, dist_center);
988 hit.f.base_index = base_index;
989 hit.f.ele = efa_test;
992 hit.f_zbuf.base_index = base_index;
993 hit.f_zbuf.ele = efa_zbuf;
998 float dist_center = 0.0f;
1001 uint base_index = 0;
1002 BMEdge *eed_zbuf =
nullptr;
1004 vc, &dist, dist_center_p,
true, use_cycle, &eed_zbuf, bases, &base_index);
1006 if (eed_test && dist_center_p) {
1007 dist =
min_ff(dist_margin, dist_center);
1010 hit.e.base_index = base_index;
1011 hit.e.ele = eed_test;
1014 hit.e_zbuf.base_index = base_index;
1015 hit.e_zbuf.ele = eed_zbuf;
1020 uint base_index = 0;
1024 hit.v.base_index = base_index;
1025 hit.v.ele = eve_test;
1031 hit.f.ele =
nullptr;
1032 hit.e.ele =
nullptr;
1034 else if (hit.e.ele) {
1035 hit.f.ele =
nullptr;
1040 if ((hit.v.ele || hit.e.ele || hit.f.ele) == 0) {
1041 if (hit.e_zbuf.ele) {
1042 hit.e.base_index = hit.e_zbuf.base_index;
1043 hit.e.ele = hit.e_zbuf.ele;
1045 else if (hit.f_zbuf.ele) {
1046 hit.f.base_index = hit.f_zbuf.base_index;
1047 hit.f.ele = hit.f_zbuf.ele;
1052 BLI_assert(((hit.v.ele !=
nullptr) + (hit.e.ele !=
nullptr) + (hit.f.ele !=
nullptr)) <= 1);
1055 *r_base_index = hit.v.base_index;
1058 *r_base_index = hit.e.base_index;
1061 *r_base_index = hit.f.base_index;
1068 return (hit.v.ele || hit.e.ele || hit.f.ele);
1071#undef FAKE_SELECT_MODE_BEGIN
1072#undef FAKE_SELECT_MODE_END
1095 bool use_boundary_vertices,
1096 bool use_boundary_edges,
1097 int *r_base_index_vert,
1098 int *r_base_index_edge,
1099 int *r_base_index_face,
1104 const float mval_fl[2] = {float(vc->
mval[0]), float(vc->
mval[1])};
1105 float ray_origin[3], ray_direction[3];
1110 } best = {0,
nullptr};
1117 } best_vert = {0,
nullptr};
1122 } best_edge = {0,
nullptr};
1127 } best_face = {0,
nullptr};
1133 float dist_sq_best_vert =
FLT_MAX;
1134 float dist_sq_best_edge =
FLT_MAX;
1135 float dist_sq_best_face =
FLT_MAX;
1137 const bool use_vert = (r_eve !=
nullptr);
1138 const bool use_edge = (r_eed !=
nullptr);
1139 const bool use_face = (r_efa !=
nullptr);
1141 for (
const int base_index : bases.
index_range()) {
1142 Base *base_iter = bases[base_index];
1150 copy_m3_m4(imat3, obedit->object_to_world().ptr());
1166 if ((use_boundary_vertices || use_boundary_edges) && (use_vert || use_edge)) {
1175 if (use_vert && use_boundary_vertices) {
1176 for (
uint j = 0; j < 2; j++) {
1180 obedit->object_to_world().ptr(),
1184 ray_origin, ray_direction, point);
1185 if (dist_sq_test < dist_sq_best_vert) {
1186 dist_sq_best_vert = dist_sq_test;
1187 best_vert.base_index = base_index;
1190 if (dist_sq_test < dist_sq_best) {
1191 dist_sq_best = dist_sq_test;
1192 best.base_index = base_index;
1198 if (use_edge && use_boundary_edges) {
1202 ray_origin, ray_direction,
e->v1->co,
e->v2->co, point, &depth);
1212 mul_m4_v3(obedit->object_to_world().ptr(), point);
1214 ray_origin, ray_direction, point);
1215 if (dist_sq_test < dist_sq_best_edge) {
1216 dist_sq_best_edge = dist_sq_test;
1217 best_edge.base_index = base_index;
1220 if (dist_sq_test < dist_sq_best) {
1221 dist_sq_best = dist_sq_test;
1222 best.base_index = base_index;
1231 if (use_vert && !use_boundary_vertices) {
1241 obedit->object_to_world().ptr(),
1244 ray_origin, ray_direction, point);
1245 if (dist_sq_test < dist_sq_best_vert) {
1246 dist_sq_best_vert = dist_sq_test;
1247 best_vert.base_index = base_index;
1250 if (dist_sq_test < dist_sq_best) {
1251 dist_sq_best = dist_sq_test;
1252 best.base_index = base_index;
1258 if (use_edge && !use_boundary_edges) {
1275 mul_m4_v3(obedit->object_to_world().ptr(), point);
1277 ray_origin, ray_direction, point);
1278 if (dist_sq_test < dist_sq_best_edge) {
1279 dist_sq_best_edge = dist_sq_test;
1280 best_edge.base_index = base_index;
1283 if (dist_sq_test < dist_sq_best) {
1284 dist_sq_best = dist_sq_test;
1285 best.base_index = base_index;
1306 mul_m4_v3(obedit->object_to_world().ptr(), point);
1308 ray_origin, ray_direction, point);
1309 if (dist_sq_test < dist_sq_best_face) {
1310 dist_sq_best_face = dist_sq_test;
1311 best_face.base_index = base_index;
1312 best_face.ele = (
BMElem *)f;
1314 if (dist_sq_test < dist_sq_best) {
1315 dist_sq_best = dist_sq_test;
1316 best.base_index = base_index;
1324 *r_base_index_vert = best_vert.base_index;
1325 *r_base_index_edge = best_edge.base_index;
1326 *r_base_index_face = best_face.base_index;
1338 if (best_vert.ele) {
1339 *r_eve = (
BMVert *)best_vert.ele;
1341 if (best_edge.ele) {
1342 *r_eed = (
BMEdge *)best_edge.ele;
1344 if (best_face.ele) {
1345 *r_efa = (
BMFace *)best_face.ele;
1348 return (best_vert.ele !=
nullptr || best_edge.ele !=
nullptr || best_face.ele !=
nullptr);
1362 bool changed =
false;
1365 int(*group_index)[2];
1369 if (
bm->totfacesel < 2) {
1380 for (
i = 0;
i < group_tot;
i++) {
1384 const int fg_sta = group_index[
i][0];
1385 const int fg_len = group_index[
i][1];
1389 for (j = 0; j < fg_len; j++) {
1428 ot->name =
"Select Similar Regions";
1429 ot->idname =
"MESH_OT_select_similar_region";
1430 ot->description =
"Select similar face regions to the current selection";
1501 "Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection");
1504 "Edge select - Shift-Click for multiple modes, "
1505 "Ctrl-Click expands/contracts selection depending on the current mode");
1507 return TIP_(
"Face select - Shift-Click for multiple modes, Ctrl-Click expands selection");
1519 {0,
"DISABLE",
false,
"Disable",
"Disable selected markers"},
1520 {1,
"ENABLE",
false,
"Enable",
"Enable selected markers"},
1521 {2,
"TOGGLE",
false,
"Toggle",
"Toggle disabled flag for selected markers"},
1522 {0,
nullptr, 0,
nullptr,
nullptr},
1526 ot->name =
"Select Mode";
1527 ot->idname =
"MESH_OT_select_mode";
1528 ot->description =
"Change selection mode";
1549 ot->srna,
"action", actions_items, 2,
"Action",
"Selection action to execute");
1562 int r_count_by_select[2])
1568 r_count_by_select[0] = r_count_by_select[1] = 0;
1585 if (r_count_by_select[0] && r_count_by_select[1]) {
1586 r_count_by_select[0] = r_count_by_select[1] = -1;
1599 bool changed =
false;
1630 for (
Object *obedit : objects) {
1653 edarray[edindex] = eed;
1658 bool changed =
false;
1660 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1661 eed = edarray[edindex];
1669 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1670 eed = edarray[edindex];
1697 ot->name =
"Multi Select Loops";
1698 ot->idname =
"MESH_OT_loop_multi_select";
1699 ot->description =
"Select a loop of connected edges by connection type";
1739 bool edge_boundary =
false;
1744 int count_by_select[2];
1748 if (count_by_select[!
select] == 0) {
1749 edge_boundary =
true;
1753 if (count_by_select[!
select] == 0) {
1754 edge_boundary =
false;
1763 if (edge_boundary) {
1766 else if (non_manifold) {
1775 bContext *
C,
const int mval[2],
bool extend,
bool deselect,
bool toggle,
bool ring)
1777 Base *basact =
nullptr;
1784 bool select_clear =
false;
1785 bool select_cycle =
true;
1789 mvalf[0] = float(vc.
mval[0] = mval[0]);
1790 mvalf[1] = float(vc.
mval[1] = mval[1]);
1793 const short selectmode = em_original->
selectmode;
1800 int base_index = -1;
1802 basact = bases[base_index];
1813 if (em ==
nullptr || eed ==
nullptr) {
1817 if (extend ==
false && deselect ==
false && toggle ==
false) {
1818 select_clear =
true;
1824 else if (deselect) {
1832 select_cycle =
false;
1836 for (
Base *base_iter : bases) {
1837 Object *ob_iter = base_iter->object;
1844 if (em_iter == em) {
1872 float v1_co[2], v2_co[2];
1891 printf(
"mouse to v1: %f\nmouse to v2: %f\n",
1920 if (tdist < best_dist) {
1961 ot->name =
"Loop Select";
1962 ot->idname =
"MESH_OT_loop_select";
1963 ot->description =
"Select a loop of connected edges";
1975 prop =
RNA_def_boolean(
ot->srna,
"extend",
false,
"Extend Select",
"Extend the selection");
1977 prop =
RNA_def_boolean(
ot->srna,
"deselect",
false,
"Deselect",
"Remove from the selection");
1979 prop =
RNA_def_boolean(
ot->srna,
"toggle",
false,
"Toggle Select",
"Toggle the selection");
1988 ot->name =
"Edge Ring Select";
1989 ot->idname =
"MESH_OT_edgering_select";
1990 ot->description =
"Select an edge ring";
2001 prop =
RNA_def_boolean(
ot->srna,
"extend",
false,
"Extend",
"Extend the selection");
2003 prop =
RNA_def_boolean(
ot->srna,
"deselect",
false,
"Deselect",
"Remove from the selection");
2005 prop =
RNA_def_boolean(
ot->srna,
"toggle",
false,
"Toggle Select",
"Toggle the selection");
2028 for (
Object *obedit : objects) {
2037 for (
Object *obedit : objects) {
2061 ot->name =
"(De)select All";
2062 ot->idname =
"MESH_OT_select_all";
2063 ot->description =
"(De)select all vertices, edges or faces";
2088 for (
Object *obedit : objects) {
2105 ot->name =
"Select Interior Faces";
2106 ot->idname =
"MESH_OT_select_interior_faces";
2107 ot->description =
"Select faces where all edges have more than 2 face users";
2128 int base_index_active = -1;
2135 vc.
mval[0] = mval[0];
2136 vc.
mval[1] = mval[1];
2141 bool changed =
false;
2149 else if (found ||
params.deselect_all) {
2151 for (
Base *base_iter : bases) {
2152 Object *ob_iter = base_iter->object;
2162 Base *basact = bases[base_index_active];
2330 nextese = ese->
next;
2340 nextese = ese->
next;
2350 nextese = ese->
next;
2415 const short selectmode_old,
2416 const short selectmode_new)
2434 if (
bm->totvertsel == 0) {
2467 if (
bm->totedgesel == 0) {
2497 if (
bm->totfacesel == 0) {
2526 const short selectmode_toggle,
2528 const bool use_extend,
2529 const bool use_expand)
2537 short selectmode_new;
2547 if (em ==
nullptr) {
2554 const short selectmode_old = selectmode_new;
2556 bool only_update =
false;
2563 if ((selectmode_old & selectmode_toggle) == 0) {
2567 selectmode_new &= ~selectmode_toggle;
2571 if ((selectmode_old & selectmode_toggle) != 0) {
2575 selectmode_new |= selectmode_toggle;
2579 if (selectmode_old == selectmode_toggle) {
2583 selectmode_new ^= selectmode_toggle;
2594 for (
Object *ob_iter : objects) {
2602 if (use_extend ==
false || selectmode_new == 0) {
2605 for (
Object *ob_iter : objects) {
2612 switch (selectmode_toggle) {
2614 if (use_extend ==
false || selectmode_new == 0) {
2620 if (use_extend ==
false || selectmode_new == 0) {
2626 if (use_extend ==
false || selectmode_new == 0) {
2639 for (
Object *ob_iter : objects) {
2656 bool changed =
false;
2657 bool changed_toolsettings =
false;
2661 changed_toolsettings =
true;
2664 for (
Object *ob_iter : objects) {
2675 if (changed_toolsettings) {
2680 return changed || changed_toolsettings;
2716 if (objects.
size() <= 1) {
2720 bool changed =
false;
2722 for (
Object *obedit : objects) {
2739 const short selectmode_disable,
2740 const short selectmode_fallback)
2745 const short selectmode = (em->
selectmode == selectmode_disable) ?
2746 selectmode_fallback :
2768 bool changed =
false;
2774 if (efa->
mat_nr == index) {
2827 bool changed_multi =
false;
2828 for (
Base *base_iter : bases) {
2829 Object *ob_iter = base_iter->object;
2838 changed_multi =
true;
2840 return changed_multi;
2854 const short selectmode_disable,
2855 const short selectmode_fallback)
2857 bool changed_multi =
false;
2858 for (
Base *base_iter : bases) {
2859 Object *ob_iter = base_iter->object;
2863 changed_multi =
true;
2866 return changed_multi;
2870 const short selectmode_disable,
2871 const short selectmode_fallback)
2918 if (!
ELEM(
i, -1, face_index)) {
2919 if (loop_index == 2) {
2922 r_l_pair[loop_index++] = l_iter;
2925 return (loop_index == 2);
2940 BMFace *f = f_link->face;
2941 area += f_link->area;
2944 BMLoop *l_iter, *l_first;
2948 float cost_test = 0.0f;
2951 BMLoop *l_radial_iter = l_iter;
2954 if (!
ELEM(i_other, -1,
i)) {
2970 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
2972 if (cost_count >= 2) {
2977 }
while ((l_iter = l_iter->
next) != l_first);
2979 return found ? cost / area :
FLT_MAX;
2986 bool changed =
false;
2991 bool has_nonmanifold =
false;
2998 has_nonmanifold =
true;
3003 edge_lengths[
i] = -1.0;
3010 if (has_nonmanifold ==
false) {
3017 int(*fgroup_index)[2];
3041 for (
int i = 0;
i < fgroup_len;
i++) {
3042 const int fg_sta = fgroup_index[
i][0];
3043 const int fg_len = fgroup_index[
i][1];
3044 for (
int j = 0; j < fg_len; j++) {
3045 const int face_index = fgroup_array[fg_sta + j];
3049 BMFaceLink *f_link = &f_link_array[face_index];
3063 for (
int i = 0;
i < fgroup_len;
i++) {
3069 fgroup_table[
i] =
nullptr;
3081#define USE_DELAY_FACE_GROUP_COST_CALC
3085#if defined(USE_DELAY_FACE_GROUP_COST_CALC)
3089 if (fgroup_dirty[
i]) {
3099 fgroup_table[
i] =
nullptr;
3101 fgroup_dirty[
i] =
false;
3116 fgroup_table[i_min] =
nullptr;
3120 BMFace *f = f_link->face;
3124 BMLoop *l_iter, *l_first;
3140 std::swap(i_a, i_b);
3153 fgroup_table[i_b] =
nullptr;
3158 if (fgroup_dirty[i_a] ==
false) {
3161 fgroup_dirty[i_a] =
true;
3168 if (l_radial_iter != l_iter) {
3171 if (!
ELEM(i_other, -1, i_min)) {
3172 if ((fgroup_table[i_other] !=
nullptr) && (fgroup_dirty[i_other] ==
false)) {
3173#if !defined(USE_DELAY_FACE_GROUP_COST_CALC)
3176 fgroup_dirty[i_other] =
true;
3179 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
3182 }
while ((l_iter = l_iter->
next) != l_first);
3185 for (
int index = 0; index <
STACK_SIZE(fgroup_recalc_stack); index++) {
3186 const int i = fgroup_recalc_stack[index];
3187 if (fgroup_table[
i] !=
nullptr && fgroup_dirty[
i] ==
true) {
3195 fgroup_table[
i] =
nullptr;
3198 fgroup_dirty[
i] =
false;
3224#define USE_LINKED_SELECT_DEFAULT_HACK
3254 if (
e->l &&
e->l->radial_next !=
e->l) {
3255 const short mat_nr =
e->l->f->mat_nr;
3256 BMLoop *l_iter =
e->l->radial_next;
3258 if (l_iter->
f->
mat_nr != mat_nr) {
3267 e, delimit_data->cd_loop_type, delimit_data->cd_loop_offset) == 0)
3276#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3285 char *delimit_last = &delimit_last_store[delimit_last_index];
3291 *delimit_last = delimit;
3294 delimit = *delimit_last;
3312 DelimitData delimit_data{};
3317 if (delimit_data.cd_loop_offset == -1) {
3349#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3359 for (
Object *obedit : objects) {
3366 int delimit = delimit_init;
3553 ot->name =
"Select Linked All";
3554 ot->idname =
"MESH_OT_select_linked";
3555 ot->description =
"Select all vertices connected to the current selection";
3569 "Delimit selected region");
3570#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3612 BMW_ITER (ele_walk, &walker, eve) {
3649 BMW_ITER (ele_walk, &walker, eed) {
3704 Base *basact =
nullptr;
3725 bool has_edges =
false;
3726 for (
Base *base : bases) {
3727 Object *ob_iter = base->object;
3733 if (has_edges ==
false) {
3738 vc.
mval[0] =
event->mval[0];
3739 vc.
mval[1] =
event->mval[1];
3743 int base_index = -1;
3748 basact = bases[base_index];
3755#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3785 Object *obedit =
nullptr;
3797 if (ele ==
nullptr) {
3804#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3823 ot->name =
"Select Linked";
3824 ot->idname =
"MESH_OT_select_linked_pick";
3825 ot->description =
"(De)select all vertices linked to the edge under the mouse cursor";
3841 "Delimit selected region");
3842#ifdef USE_LINKED_SELECT_DEFAULT_HACK
3847 prop =
RNA_def_int(
ot->srna,
"object_index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
3849 prop =
RNA_def_int(
ot->srna,
"index", -1, -1, INT_MAX,
"",
"", 0, INT_MAX);
3870 for (
Object *obedit : objects) {
3872 bool changed =
false;
3892 if (exclude_nonmanifold) {
3901 bool all_edges_manifold =
true;
3904 all_edges_manifold =
false;
3909 if (all_edges_manifold ==
false) {
3955 ot->name =
"Select By Pole Count";
3957 "Select vertices at poles by the number of connected edges. "
3958 "In edge and face mode the geometry connected to the vertices is selected";
3959 ot->idname =
"MESH_OT_select_by_pole_count";
3969 RNA_def_int(
ot->srna,
"pole_count", 4, 0, INT_MAX,
"Pole Count",
"", 0, INT_MAX);
3975 "Type of comparison to make");
3978 ot->srna,
"exclude_nonmanifold",
true,
"Exclude Non Manifold",
"Exclude non-manifold poles");
3997 for (
Object *obedit : objects) {
3999 bool changed =
false;
4034 ot->name =
"Select Faces by Sides";
4035 ot->description =
"Select vertices or faces by the number of face sides";
4036 ot->idname =
"MESH_OT_select_face_by_sides";
4046 RNA_def_int(
ot->srna,
"number", 4, 3, INT_MAX,
"Number of Vertices",
"", 3, INT_MAX);
4052 "Type of comparison to make");
4071 for (
Object *obedit : objects) {
4076 bool changed =
false;
4117 bool is_loose =
true;
4145 ot->name =
"Select Loose Geometry";
4146 ot->description =
"Select loose geometry based on the selection mode";
4147 ot->idname =
"MESH_OT_select_loose";
4175 int tot_mirr = 0, tot_fail = 0;
4180 for (
Object *obedit : objects) {
4187 int tot_mirr_iter = 0, tot_fail_iter = 0;
4189 for (
int axis = 0; axis < 3; axis++) {
4190 if ((1 << axis) & axis_flag) {
4192 static_cast<const Mesh *
>(obedit->data),
4200 if (tot_mirr_iter) {
4207 tot_fail += tot_fail_iter;
4208 tot_mirr += tot_mirr_iter;
4211 if (tot_mirr || tot_fail) {
4220 ot->name =
"Select Mirror";
4221 ot->description =
"Select mesh items at mirrored locations";
4222 ot->idname =
"MESH_OT_select_mirror";
4234 RNA_def_boolean(
ot->srna,
"extend",
false,
"Extend",
"Extend the existing selection");
4251 for (
Object *obedit : objects) {
4255 if ((
bm->totvertsel == 0) && (
bm->totedgesel == 0) && (
bm->totfacesel == 0)) {
4270 ot->name =
"Select More";
4271 ot->idname =
"MESH_OT_select_more";
4272 ot->description =
"Select more vertices, edges or faces connected to initial selection";
4282 ot->srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4299 for (
Object *obedit : objects) {
4303 if ((
bm->totvertsel == 0) && (
bm->totedgesel == 0) && (
bm->totfacesel == 0)) {
4318 ot->name =
"Select Less";
4319 ot->idname =
"MESH_OT_select_less";
4320 ot->description =
"Deselect vertices, edges or faces at the boundary of each selection region";
4330 ot->srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
4371 int walktype = 0, itertype = 0, flushtype = 0;
4372 short mask_vert = 0, mask_edge = 0, mask_face = 0;
4375 if (h_act ==
nullptr) {
4381 switch (h_act->
htype) {
4432 for (ele =
static_cast<BMElem *
>(
BMW_begin(&walker, h_act)); ele !=
nullptr;
4535 bool found_active_elt =
false;
4540 for (
Object *obedit : objects) {
4548 found_active_elt =
true;
4550 params.calc_looptris =
false;
4551 params.calc_normals =
false;
4552 params.is_destructive =
false;
4557 if (!found_active_elt) {
4568 ot->name =
"Checker Deselect";
4569 ot->idname =
"MESH_OT_select_nth";
4570 ot->description =
"Deselect every Nth element starting from the active vertex, edge or face";
4611 for (
Object *obedit : objects) {
4626 if (angle_cos < angle_limit_cos) {
4651 ot->name =
"Select Sharp Edges";
4652 ot->description =
"Select all sharp enough edges";
4653 ot->idname =
"MESH_OT_edges_select_sharp";
4690 for (
Object *obedit : objects) {
4694 if (
bm->totfacesel == 0) {
4700 BMIter iter, liter, liter2;
4731 if (angle_cos > angle_limit_cos) {
4751 ot->name =
"Select Linked Flat Faces";
4752 ot->description =
"Select linked faces by angle";
4753 ot->idname =
"MESH_OT_faces_select_linked_flat";
4798 for (
Object *obedit : objects) {
4804 bool changed =
false;
4825 if (use_wire || use_boundary || use_multi_face || use_non_contiguous) {
4857 ot->name =
"Select Non-Manifold";
4858 ot->description =
"Select all non-manifold vertices or edges";
4859 ot->idname =
"MESH_OT_select_non_manifold";
4872 RNA_def_boolean(
ot->srna,
"use_boundary",
true,
"Boundaries",
"Boundary edges");
4874 ot->srna,
"use_multi_face",
true,
"Multiple Faces",
"Edges shared by more than two faces");
4876 "use_non_contiguous",
4879 "Edges between faces pointing in alternate directions");
4882 ot->srna,
"use_verts",
true,
"Vertices",
"Vertices connecting multiple face regions");
4902 for (
const int ob_index : objects.
index_range()) {
4903 Object *obedit = objects[ob_index];
4906 int seed_iter =
seed;
4914 int elem_map_len = 0;
4920 elem_map[elem_map_len++] = eve;
4925 const int count_select = elem_map_len * randfac;
4926 for (
int i = 0;
i < count_select;
i++) {
4932 int elem_map_len = 0;
4938 elem_map[elem_map_len++] = eed;
4942 const int count_select = elem_map_len * randfac;
4943 for (
int i = 0;
i < count_select;
i++) {
4949 int elem_map_len = 0;
4955 elem_map[elem_map_len++] = efa;
4959 const int count_select = elem_map_len * randfac;
4960 for (
int i = 0;
i < count_select;
i++) {
4984 ot->name =
"Select Random";
4985 ot->description =
"Randomly select vertices";
4986 ot->idname =
"MESH_OT_select_random";
5035 for (
Object *obedit : objects) {
5040 if (cd_dvert_offset == -1) {
5047 bool changed =
false;
5060 if (
ELEM(
nullptr, dv, dv->
dw)) {
5079 ot->name =
"Select Ungrouped";
5080 ot->idname =
"MESH_OT_select_ungrouped";
5081 ot->description =
"Select vertices without a group";
5116 if (v_act ==
nullptr) {
5118 op->
reports,
RPT_WARNING,
"This operator requires an active vertex (last selected)");
5125 float axis_mat[3][3];
5138 const float *axis_vector = axis_mat[axis];
5141 float vertex_world[3];
5142 mul_v3_m4v3(vertex_world, obedit->object_to_world().ptr(), v_act->
co);
5143 value =
dot_v3v3(axis_vector, vertex_world);
5155 for (
Object *obedit_iter : objects) {
5159 if (
bm->totvert ==
bm->totvertsel) {
5165 bool changed =
false;
5169 float v_iter_world[3];
5170 mul_v3_m4v3(v_iter_world, obedit_iter->object_to_world().ptr(),
v->co);
5171 const float value_iter =
dot_v3v3(axis_vector, v_iter_world);
5174 if (
fabsf(value_iter - value) < limit) {
5180 if (value_iter < value) {
5186 if (value_iter > value) {
5209 {0,
nullptr, 0,
nullptr,
nullptr},
5213 ot->name =
"Select Axis";
5214 ot->description =
"Select all data in the mesh on a single axis";
5215 ot->idname =
"MESH_OT_select_axis";
5230 "Axis orientation");
5237 "Select the axis to compare each vertex on");
5239 ot->srna,
"threshold", 0.0001f, 0.000001f, 50.0f,
"Threshold",
"", 0.00001f, 10.0f);
5254 bool changed =
false;
5255 for (
Object *obedit : objects) {
5272 int tot = 0, totsel = 0;
5279 if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1)) {
5311 ot->name =
"Select Boundary Loop";
5312 ot->idname =
"MESH_OT_region_to_loop";
5313 ot->description =
"Select boundary edges around the selected faces";
5364 memcpy(region_alloc, region.
data(), region.
as_span().size_in_bytes());
5365 *region_out = region_alloc;
5366 return region.
size();
5394 GSet *visit_face_set;
5415 qsort(edges, edges_len,
sizeof(*edges),
verg_radial);
5417 for (
i = 0;
i < edges_len;
i++) {
5420 BMFace **region =
nullptr, **region_out;
5436 if (!region || (selbigger ? c >= tot : c < tot)) {
5444 region = region_out;
5455 for (j = 0; j < tot; j++) {
5482 for (
Object *obedit : objects) {
5501 bool changed =
true;
5527 ot->name =
"Select Loop Inner-Region";
5528 ot->idname =
"MESH_OT_loop_to_region";
5529 ot->description =
"Select region of faces inside of a selected loop of edges";
5542 "Select bigger regions instead of smaller ones");
5552 const Mesh *mesh =
static_cast<const Mesh *
>(obedit->
data);
5567 C,
"The active attribute must be on the vertex, edge, or face domain");
5584 return std::nullopt;
5595 for (
Object *obedit : objects) {
5596 Mesh *mesh =
static_cast<Mesh *
>(obedit->data);
5621 bool changed =
false;
5647 ot->name =
"Select by Attribute";
5648 ot->idname =
"MESH_OT_select_by_attribute";
5649 ot->description =
"Select elements based on the active boolean attribute";
std::optional< blender::StringRefNull > BKE_attributes_active_name_get(AttributeOwner &owner)
blender::bke::AttrDomain BKE_attribute_domain(const AttributeOwner &owner, const struct CustomDataLayer *layer)
const struct CustomDataLayer * BKE_attribute_search(const AttributeOwner &owner, blender::StringRef name, eCustomDataMask type, AttrDomainMask domain_mask)
SpaceImage * CTX_wm_space_image(const bContext *C)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
blender::Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
blender::Span< blender::float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
int BKE_mesh_wrapper_vert_len(const Mesh *mesh)
General operations, lookup, etc. for blender objects.
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
void BKE_report(ReportList *reports, eReportType type, const char *message)
#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)
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp)
GSet * BLI_gset_ptr_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_gset_add(GSet *gs, void *key)
A min-heap / priority queue ADT.
HeapNode * BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
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)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_node_ptr(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) 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 mat[4][4], const float vec[3])
bool invert_m3(float mat[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)
#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)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
Object is a sort of wrapper for general info.
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
void DRW_select_buffer_context_create(Depsgraph *depsgraph, blender::Span< Base * > bases, short select_mode)
uint DRW_select_buffer_sample_point(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2])
bool DRW_select_buffer_elem_get(uint sel_id, uint &r_elem, uint &r_base_index, char &r_elem_type)
uint DRW_select_buffer_find_nearest_to_point(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2], uint id_min, uint id_max, uint *dist)
void EDBM_flag_disable_all(BMEditMesh *em, char hflag)
void ED_mesh_report_mirror_ex(wmOperator *op, int totmirr, int totfail, char selectmode)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
BMVert * EDBM_verts_mirror_get(BMEditMesh *em, BMVert *v)
void EDBM_select_more(BMEditMesh *em, bool use_face_step)
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
void EDBM_deselect_flush(BMEditMesh *em)
void EDBM_selectmode_flush(BMEditMesh *em)
void EDBM_selectmode_flush_ex(BMEditMesh *em, short selectmode)
void EDBM_verts_mirror_cache_end(BMEditMesh *em)
BMEdge * EDBM_verts_mirror_get_edge(BMEditMesh *em, BMEdge *e)
BMFace * EDBM_verts_mirror_get_face(BMEditMesh *em, BMFace *f)
void EDBM_flag_enable_all(BMEditMesh *em, char hflag)
void EDBM_select_less(BMEditMesh *em, bool use_face_step)
void EDBM_select_flush(BMEditMesh *em)
bool ED_operator_editmesh_region_view3d(bContext *C)
bool ED_operator_editmesh(bContext *C)
bool ED_view3d_win_to_ray_clipped(Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
float ED_view3d_select_dist_px()
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT
void mesh_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BMVert *eve, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
@ V3D_PROJ_TEST_CLIP_NEAR
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void mesh_foreachScreenEdge(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, float dist)
void mesh_foreachScreenFace(const ViewContext *vc, void(*func)(void *user_data, BMFace *efa, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
#define V3D_PROJ_TEST_CLIP_DEFAULT
#define XRAY_FLAG_ENABLED(v3d)
void view3d_operator_needs_gpu(const bContext *C)
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
#define BM_ELEM_CD_GET_BOOL(ele, offset)
#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)
BMesh const char void * data
BMVert * BM_mesh_active_vert_get(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)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
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)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
#define BM_select_history_store(bm, ele)
#define BM_select_history_remove(bm, ele)
void BM_mesh_elem_toolflags_clear(BMesh *bm)
void BM_mesh_elem_toolflags_ensure(BMesh *bm)
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)
BMEdge * BM_edge_at_index_find_or_table(BMesh *bm, const int index)
BMFace * BM_face_at_index_find_or_table(BMesh *bm, const int index)
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)
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const blender::Span< blender::float3 > vert_positions)
float BM_face_calc_area(const BMFace *f)
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_vert_edge_count_at_most(const BMVert *v, const int count_max)
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 BMLoop * l_b
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_begin(BMWalker *walker, void *start)
void BMW_init(BMWalker *walker, BMesh *bm, int type, short mask_vert, short mask_edge, short mask_face, BMWFlag flag, int layer)
Initialize Walker.
void BMW_end(BMWalker *walker)
End Walker.
void * BMW_step(BMWalker *walker)
Step Walker.
int BMW_current_depth(BMWalker *walker)
Walker Current Depth.
@ BMW_EDGELOOP_NONMANIFOLD
#define BMW_ITER(ele, walker, data)
BPy_StructRNA * depsgraph
static unsigned long seed
static AttributeOwner from_id(ID *id)
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
void append(const T &value)
IndexRange index_range() const
Span< T > as_span() const
static wmOperatorStatus edbm_select_loose_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_select_similar_region_exec(bContext *C, wmOperator *op)
static void walker_select_count(BMEditMesh *em, int walkercode, void *start, int r_count_by_select[2])
BMVert * EDBM_vert_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan_p, const bool use_select_bias, bool use_cycle, const Span< Base * > bases, uint *r_base_index)
void MESH_OT_select_less(wmOperatorType *ot)
bool EDBM_selectmode_toggle_multi(bContext *C, const short selectmode_toggle, const int action, const bool use_extend, const bool use_expand)
bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, const Span< Base * > bases, bool use_boundary_vertices, bool use_boundary_edges, int *r_base_index_vert, int *r_base_index_edge, int *r_base_index_face, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
static void findnearestface__doClosest(void *user_data, BMFace *efa, const float screen_co[2], int index)
static void walker_deselect_nth(BMEditMesh *em, const CheckerIntervalParams *op_params, BMHeader *h_act)
static wmOperatorStatus edbm_select_by_attribute_exec(bContext *C, wmOperator *)
static void find_nearest_edge__doClosest(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)
static float bm_interior_face_group_calc_cost(ListBase *ls, const float *edge_lengths)
static wmOperatorStatus edbm_select_linked_pick_exec(bContext *C, wmOperator *op)
BMEdge * EDBM_edge_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
BMVert * EDBM_vert_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
static bool walker_select(BMEditMesh *em, int walkercode, void *start, const bool select)
static wmOperatorStatus edbm_select_mode_exec(bContext *C, wmOperator *op)
void MESH_OT_loop_to_region(wmOperatorType *ot)
void MESH_OT_select_mode(wmOperatorType *ot)
void EDBM_select_toggle_all(BMEditMesh *em)
static bool edbm_deselect_nth(BMEditMesh *em, const CheckerIntervalParams *op_params)
static void select_linked_delimit_end(BMEditMesh *em)
void MESH_OT_select_similar_region(wmOperatorType *ot)
static void find_nearest_face_center__doZBuf(void *user_data, BMFace *efa, const float screen_co[2], int)
#define FIND_NEAR_SELECT_BIAS
static wmOperatorStatus edbm_select_by_pole_count_exec(bContext *C, wmOperator *op)
static bool unified_findnearest(ViewContext *vc, const Span< Base * > bases, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
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, const Span< Base * > bases, uint *r_base_index)
static wmOperatorStatus edbm_select_less_exec(bContext *C, wmOperator *op)
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, const Span< Base * > bases, uint *r_base_index)
void MESH_OT_select_linked_pick(wmOperatorType *ot)
static bool edbm_select_by_attribute_poll(bContext *C)
static bool is_count_a_match(const eElemCountType type, const int value_test, const int value_reference)
static int loop_find_region(BMLoop *l, int flag, GSet *visit_face_set, BMFace ***region_out)
void EDBM_select_swap(BMEditMesh *em)
static void mouse_mesh_loop_edge_ring(BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
static wmOperatorStatus edbm_region_to_loop_exec(bContext *C, wmOperator *)
static void mouse_mesh_loop_face(BMEditMesh *em, BMEdge *eed, bool select, bool select_clear)
BMFace * EDBM_face_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool deselect, bool toggle, bool ring)
static wmOperatorStatus edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void MESH_OT_select_random(wmOperatorType *ot)
static int verg_radial(const void *va, const void *vb)
static void find_nearest_edge_center__doZBuf(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int)
static int loop_find_regions(BMEditMesh *em, const bool selbigger)
static wmOperatorStatus edbm_select_more_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_select_all_exec(bContext *C, wmOperator *op)
void EDBM_select_mirrored(BMEditMesh *em, const Mesh *mesh, const int axis, const bool extend, int *r_totmirr, int *r_totfail)
void MESH_OT_select_nth(wmOperatorType *ot)
static wmOperatorStatus edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
void MESH_OT_loop_multi_select(wmOperatorType *ot)
ViewContext em_setup_viewcontext(bContext *C)
void EDBM_selectmode_convert(BMEditMesh *em, const short selectmode_old, const short selectmode_new)
static bool bm_interior_loop_filter_fn(const BMLoop *l, void *)
static wmOperatorStatus edbm_select_axis_exec(bContext *C, wmOperator *op)
static void select_linked_delimit_validate(BMesh *bm, int *delimit)
static wmOperatorStatus edbm_faces_select_interior_exec(bContext *C, wmOperator *)
bool EDBM_unified_findnearest(ViewContext *vc, const Span< Base * > bases, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
static bool edbm_selectmode_sync_multi_ex(Span< Object * > objects)
void MESH_OT_select_loose(wmOperatorType *ot)
static bool select_linked_delimit_test(BMEdge *e, int delimit, const DelimitData *delimit_data)
bool EDBM_deselect_by_material(BMEditMesh *em, const short index, const bool select)
void MESH_OT_select_by_pole_count(wmOperatorType *ot)
void MESH_OT_select_by_attribute(wmOperatorType *ot)
static bool edbm_vert_or_edge_select_mode_poll(bContext *C)
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)
void MESH_OT_select_axis(wmOperatorType *ot)
static wmOperatorStatus edbm_select_face_by_sides_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
void MESH_OT_select_mirror(wmOperatorType *ot)
static wmOperatorStatus edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_select_mirror_exec(bContext *C, wmOperator *op)
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 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)
bool EDBM_selectmode_disable_multi_ex(Scene *scene, const Span< Base * > bases, const short selectmode_disable, const short selectmode_fallback)
static wmOperatorStatus edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool EDBM_mesh_deselect_all_multi(bContext *C)
void EDBM_selectmode_set(BMEditMesh *em, const short selectmode)
static wmOperatorStatus edbm_select_random_exec(bContext *C, wmOperator *op)
static bool bm_edge_is_select_isolated(BMEdge *e)
void MESH_OT_select_interior_faces(wmOperatorType *ot)
bool EDBM_selectmode_disable_multi(bContext *C, const short selectmode_disable, const short selectmode_fallback)
void MESH_OT_select_linked(wmOperatorType *ot)
static wmOperatorStatus edbm_select_linked_exec(bContext *C, wmOperator *op)
static void select_linked_delimit_begin(BMesh *bm, int delimit)
static bool bm_interior_edge_is_manifold_except_face_index(BMEdge *e, int face_index, BMLoop *r_l_pair[2])
static void findnearestvert__doClosest(void *user_data, BMVert *eve, const float screen_co[2], int index)
void MESH_OT_select_all(wmOperatorType *ot)
void MESH_OT_select_more(wmOperatorType *ot)
#define FIND_NEAR_CYCLE_THRESHOLD_MIN
static std::string edbm_select_mode_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
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 wmOperatorStatus edbm_loop_to_region_exec(bContext *C, wmOperator *op)
static const EnumPropertyItem elem_count_compare_items[]
bool EDBM_selectmode_set_multi(bContext *C, const short selectmode)
static BMElem * edbm_select_id_bm_elem_get(const Span< Base * > bases, const uint sel_id, uint &r_base_index)
static wmOperatorStatus edbm_select_nth_exec(bContext *C, wmOperator *op)
void MESH_OT_select_ungrouped(wmOperatorType *ot)
static wmOperatorStatus edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static std::optional< BMIterType > domain_to_iter_type(const blender::bke::AttrDomain domain)
bool EDBM_selectmode_disable(Scene *scene, BMEditMesh *em, const short selectmode_disable, const short selectmode_fallback)
bool EDBM_mesh_deselect_all_multi_ex(const Span< Base * > bases)
static wmOperatorStatus edbm_select_ungrouped_exec(bContext *C, wmOperator *op)
bool EDBM_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
bool EDBM_selectmode_set_multi_ex(Scene *scene, Span< Object * > objects, const short selectmode)
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(const Scene *scene, ViewLayer *view_layer, uint object_index, uint elem_index, Object **r_obedit)
int EDBM_elem_to_index_any_multi(const Scene *scene, ViewLayer *view_layer, BMEditMesh *em, BMElem *ele, int *r_object_index)
void * MEM_mallocN(size_t len, const char *str)
void * MEM_calloc_arrayN(size_t len, size_t size, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void base_activate(bContext *C, Base *base)
bool material_active_index_set(Object *ob, int index)
VecBase< float, 3 > float3
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
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)
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)
void RNA_def_property_float_default(PropertyRNA *prop, float value)
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, const int len, const float *default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_enum_flag(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
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
eCustomDataType cd_loop_type
float dist_center_px_manhattan
NearestEdgeUserData_Hit hit
NearestEdgeUserData_Hit hit_cycle
NearestFaceUserData_Hit hit
NearestFaceUserData_Hit hit_cycle
NearestVertUserData_Hit hit_cycle
NearestVertUserData_Hit hit
struct ToolSettings * toolsettings
wmEventModifierFlag modifier
struct ReportList * reports
bool WM_cursor_test_motion_and_update(const int mval[2])
void WM_main_add_notifier(uint type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_checker_interval_from_op(wmOperator *op, CheckerIntervalParams *op_params)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void WM_operator_properties_select_random(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable)
bool WM_operator_properties_checker_interval_test(const CheckerIntervalParams *op_params, int depth)