113 {0,
nullptr, 0,
nullptr,
nullptr},
117 const int value_test,
118 const int value_reference)
122 return (value_test < value_reference);
124 return (value_test == value_reference);
126 return (value_test > value_reference);
128 return (value_test != value_reference);
142 BMEditMesh *em,
Mesh *
mesh,
const int axis,
const bool extend,
int *r_totmirr,
int *r_totfail)
150 *r_totmirr = *r_totfail = 0;
238 *r_totmirr = totmirr;
239 *r_totfail = totfail;
245 int selectmode = em->selectmode;
246 bool changed =
false;
258 if (selectmode == 0) {
262 char symmetry_htype = 0;
272 if (std::optional<EditMeshSymmetryHelper> symmetry_helper =
288 for (
BMFace *f_orig : source_faces) {
289 symmetry_helper->set_hflag_on_mirror_faces(f_orig, hflag,
true);
305 for (
BMEdge *e_orig : source_edges) {
306 symmetry_helper->set_hflag_on_mirror_edges(e_orig, hflag,
true);
322 for (
BMVert *v_orig : source_verts) {
323 symmetry_helper->set_hflag_on_mirror_verts(v_orig, hflag,
true);
352 Object *obedit = bases[r_base_index]->object;
384#define FIND_NEAR_SELECT_BIAS 5
385#define FIND_NEAR_CYCLE_THRESHOLD_MIN 3
406 const float screen_co[2],
410 float dist_test, dist_test_bias;
418 if (dist_test_bias < data->hit.dist_bias) {
419 data->hit.dist_bias = dist_test_bias;
420 data->hit.dist = dist_test;
422 data->hit.vert = eve;
425 if (
data->use_cycle) {
426 if ((
data->hit_cycle.vert ==
nullptr) && (
index >
data->cycle_index_prev) &&
429 data->hit_cycle.dist_bias = dist_test_bias;
430 data->hit_cycle.dist = dist_test;
432 data->hit_cycle.vert = eve;
438 float *dist_px_manhattan_p,
439 const bool use_select_bias,
468 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
470 *r_base_index = base_index;
472 *dist_px_manhattan_p = dist_px_manhattan_test;
484 BMesh *prev_select_bm =
nullptr;
494 data.use_select_bias = use_select_bias;
495 data.use_cycle = use_cycle;
497 for (; base_index < bases.
size(); base_index++) {
498 Base *base_iter = bases[base_index];
501 if (use_cycle && prev_select.bm ==
bm &&
504 data.cycle_index_prev = prev_select.index;
509 data.cycle_index_prev = 0;
512 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
513 *dist_px_manhattan_p;
518 hit = (
data.use_cycle &&
data.hit_cycle.vert) ? &
data.hit_cycle : &
data.hit;
520 if (hit->
dist < *dist_px_manhattan_p) {
522 *r_base_index = base_index;
524 *dist_px_manhattan_p = hit->
dist;
529 if (hit ==
nullptr) {
533 prev_select.index = hit->
index;
534 prev_select.elem = hit->
vert;
535 prev_select.bm = prev_select_bm;
556 const float screen_co_a[2],
557 const float screen_co_b[2],
562 if (eed ==
data->edge_test) {
564 float screen_co_mid[2];
566 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
569 data->dist = std::min(dist_test,
data->dist);
600 const float screen_co_a[2],
601 const float screen_co_b[2],
605 float dist_test, dist_test_bias;
614 else if (fac >= 1.0f) {
637 if (dist_test_bias < data->hit.dist_bias) {
638 float screen_co_mid[2];
640 data->hit.dist_bias = dist_test_bias;
641 data->hit.dist = dist_test;
643 data->hit.edge = eed;
645 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
649 if (
data->use_cycle) {
650 if ((
data->hit_cycle.edge ==
nullptr) && (
index >
data->cycle_index_prev) &&
653 float screen_co_mid[2];
655 data->hit_cycle.dist_bias = dist_test_bias;
656 data->hit_cycle.dist = dist_test;
658 data->hit_cycle.edge = eed;
660 mid_v2_v2v2(screen_co_mid, screen_co_a, screen_co_b);
667 float *dist_px_manhattan_p,
668 float *r_dist_center_px_manhattan,
669 const bool use_select_bias,
703 if (r_dist_center_px_manhattan && eed) {
709 data.edge_test = eed;
718 *r_dist_center_px_manhattan =
data.dist;
723 if (dist_px_manhattan_test < *dist_px_manhattan_p) {
725 *r_base_index = base_index;
727 *dist_px_manhattan_p = dist_px_manhattan_test;
738 BMesh *prev_select_bm =
nullptr;
749 data.use_select_bias = use_select_bias;
750 data.use_cycle = use_cycle;
752 for (; base_index < bases.
size(); base_index++) {
753 Base *base_iter = bases[base_index];
756 if (use_cycle && prev_select.bm ==
bm &&
759 data.cycle_index_prev = prev_select.index;
764 data.cycle_index_prev = 0;
767 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
768 *dist_px_manhattan_p;
774 hit = (
data.use_cycle &&
data.hit_cycle.edge) ? &
data.hit_cycle : &
data.hit;
776 if (hit->
dist < *dist_px_manhattan_p) {
778 *r_base_index = base_index;
780 *dist_px_manhattan_p = hit->
dist;
785 if (hit ==
nullptr) {
789 if (r_dist_center_px_manhattan) {
793 prev_select.index = hit->
index;
794 prev_select.elem = hit->
edge;
795 prev_select.bm = prev_select_bm;
805 vc, dist_px_manhattan_p,
nullptr,
false,
false,
nullptr, {base},
nullptr);
817 const float screen_co[2],
822 if (efa ==
data->face_test) {
825 data->dist_px_manhattan = std::min(dist_test,
data->dist_px_manhattan);
848 const float screen_co[2],
852 float dist_test, dist_test_bias;
860 if (dist_test_bias < data->hit.dist_bias) {
861 data->hit.dist_bias = dist_test_bias;
862 data->hit.dist = dist_test;
864 data->hit.face = efa;
867 if (
data->use_cycle) {
868 if ((
data->hit_cycle.face ==
nullptr) && (
index >
data->cycle_index_prev) &&
871 data->hit_cycle.dist_bias = dist_test_bias;
872 data->hit_cycle.dist = dist_test;
874 data->hit_cycle.face = efa;
880 float *dist_px_manhattan_p,
881 float *r_dist_center,
882 const bool use_zbuf_single_px,
883 const bool use_select_bias,
897 uint dist_px_manhattan_test = 0;
898 if (*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px ==
false)) {
899 dist_px_manhattan_test =
uint(
905 if (dist_px_manhattan_test == 0) {
912 dist_test = dist_px_manhattan_test;
928 if (r_dist_center && efa) {
934 data.face_test = efa;
941 *r_dist_center =
data.dist_px_manhattan;
946 if (dist_test < *dist_px_manhattan_p) {
948 *r_base_index = base_index;
950 *dist_px_manhattan_p = dist_test;
960 BMesh *prev_select_bm =
nullptr;
970 data.use_select_bias = use_select_bias;
971 data.use_cycle = use_cycle;
973 for (; base_index < bases.
size(); base_index++) {
974 Base *base_iter = bases[base_index];
977 if (use_cycle && prev_select.bm ==
bm &&
980 data.cycle_index_prev = prev_select.index;
985 data.cycle_index_prev = 0;
988 data.hit.dist =
data.hit_cycle.dist =
data.hit.dist_bias =
data.hit_cycle.dist_bias =
989 *dist_px_manhattan_p;
994 hit = (
data.use_cycle &&
data.hit_cycle.face) ? &
data.hit_cycle : &
data.hit;
996 if (hit->
dist < *dist_px_manhattan_p) {
998 *r_base_index = base_index;
1000 *dist_px_manhattan_p = hit->
dist;
1001 prev_select_bm =
bm;
1005 if (hit ==
nullptr) {
1009 if (r_dist_center) {
1010 *r_dist_center = hit->
dist;
1013 prev_select.index = hit->
index;
1014 prev_select.elem = hit->
face;
1015 prev_select.bm = prev_select_bm;
1025 vc, dist_px_manhattan_p,
nullptr,
false,
false,
false,
nullptr, {base},
nullptr);
1028#undef FIND_NEAR_SELECT_BIAS
1029#undef FIND_NEAR_CYCLE_THRESHOLD_MIN
1049 const float dist_margin = (dist_init / 2);
1050 float dist = dist_init;
1065 } hit = {{
nullptr}};
1070 float dist_center = 0.0f;
1075 uint base_index = 0;
1076 BMFace *efa_zbuf =
nullptr;
1078 vc, &dist, dist_center_p,
true,
true, use_cycle, &efa_zbuf, bases, &base_index);
1080 if (efa_test && dist_center_p) {
1081 dist =
min_ff(dist_margin, dist_center);
1084 hit.f.base_index = base_index;
1085 hit.f.ele = efa_test;
1088 hit.f_zbuf.base_index = base_index;
1089 hit.f_zbuf.ele = efa_zbuf;
1094 float dist_center = 0.0f;
1097 uint base_index = 0;
1098 BMEdge *eed_zbuf =
nullptr;
1100 vc, &dist, dist_center_p,
true, use_cycle, &eed_zbuf, bases, &base_index);
1102 if (eed_test && dist_center_p) {
1103 dist =
min_ff(dist_margin, dist_center);
1106 hit.e.base_index = base_index;
1107 hit.e.ele = eed_test;
1110 hit.e_zbuf.base_index = base_index;
1111 hit.e_zbuf.ele = eed_zbuf;
1116 uint base_index = 0;
1120 hit.v.base_index = base_index;
1121 hit.v.ele = eve_test;
1127 hit.f.ele =
nullptr;
1128 hit.e.ele =
nullptr;
1130 else if (hit.e.ele) {
1131 hit.f.ele =
nullptr;
1136 if ((hit.v.ele || hit.e.ele || hit.f.ele) == 0) {
1137 if (hit.e_zbuf.ele) {
1138 hit.e.base_index = hit.e_zbuf.base_index;
1139 hit.e.ele = hit.e_zbuf.ele;
1141 else if (hit.f_zbuf.ele) {
1142 hit.f.base_index = hit.f_zbuf.base_index;
1143 hit.f.ele = hit.f_zbuf.ele;
1148 BLI_assert(((hit.v.ele !=
nullptr) + (hit.e.ele !=
nullptr) + (hit.f.ele !=
nullptr)) <= 1);
1151 *r_base_index = hit.v.base_index;
1154 *r_base_index = hit.e.base_index;
1157 *r_base_index = hit.f.base_index;
1164 return (hit.v.ele || hit.e.ele || hit.f.ele);
1167#undef FAKE_SELECT_MODE_BEGIN
1168#undef FAKE_SELECT_MODE_END
1191 bool use_boundary_vertices,
1192 bool use_boundary_edges,
1193 int *r_base_index_vert,
1194 int *r_base_index_edge,
1195 int *r_base_index_face,
1201 float ray_origin[3], ray_direction[3];
1206 } best = {0,
nullptr};
1213 } best_vert = {0,
nullptr};
1218 } best_edge = {0,
nullptr};
1223 } best_face = {0,
nullptr};
1229 float dist_sq_best_vert =
FLT_MAX;
1230 float dist_sq_best_edge =
FLT_MAX;
1231 float dist_sq_best_face =
FLT_MAX;
1233 const bool use_vert = (r_eve !=
nullptr);
1234 const bool use_edge = (r_eed !=
nullptr);
1235 const bool use_face = (r_efa !=
nullptr);
1237 for (
const int base_index : bases.
index_range()) {
1238 Base *base_iter = bases[base_index];
1245 copy_m3_m4(imat3, obedit->object_to_world().ptr());
1261 if ((use_boundary_vertices || use_boundary_edges) && (use_vert || use_edge)) {
1270 if (use_vert && use_boundary_vertices) {
1271 for (
uint j = 0; j < 2; j++) {
1275 obedit->object_to_world().ptr(),
1279 ray_origin, ray_direction, point);
1280 if (dist_sq_test < dist_sq_best_vert) {
1281 dist_sq_best_vert = dist_sq_test;
1282 best_vert.base_index = base_index;
1283 best_vert.ele =
reinterpret_cast<BMElem *
>(
v);
1285 if (dist_sq_test < dist_sq_best) {
1286 dist_sq_best = dist_sq_test;
1287 best.base_index = base_index;
1288 best.ele =
reinterpret_cast<BMElem *
>(
v);
1293 if (use_edge && use_boundary_edges) {
1297 ray_origin, ray_direction,
e->v1->
co,
e->v2->
co, point, &depth);
1307 mul_m4_v3(obedit->object_to_world().ptr(), point);
1309 ray_origin, ray_direction, point);
1310 if (dist_sq_test < dist_sq_best_edge) {
1311 dist_sq_best_edge = dist_sq_test;
1312 best_edge.base_index = base_index;
1313 best_edge.ele =
reinterpret_cast<BMElem *
>(
e);
1315 if (dist_sq_test < dist_sq_best) {
1316 dist_sq_best = dist_sq_test;
1317 best.base_index = base_index;
1318 best.ele =
reinterpret_cast<BMElem *
>(
e);
1326 if (use_vert && !use_boundary_vertices) {
1336 obedit->object_to_world().ptr(),
1339 ray_origin, ray_direction, point);
1340 if (dist_sq_test < dist_sq_best_vert) {
1341 dist_sq_best_vert = dist_sq_test;
1342 best_vert.base_index = base_index;
1343 best_vert.ele =
reinterpret_cast<BMElem *
>(
v);
1345 if (dist_sq_test < dist_sq_best) {
1346 dist_sq_best = dist_sq_test;
1347 best.base_index = base_index;
1348 best.ele =
reinterpret_cast<BMElem *
>(
v);
1353 if (use_edge && !use_boundary_edges) {
1370 mul_m4_v3(obedit->object_to_world().ptr(), point);
1372 ray_origin, ray_direction, point);
1373 if (dist_sq_test < dist_sq_best_edge) {
1374 dist_sq_best_edge = dist_sq_test;
1375 best_edge.base_index = base_index;
1376 best_edge.ele =
reinterpret_cast<BMElem *
>(
e);
1378 if (dist_sq_test < dist_sq_best) {
1379 dist_sq_best = dist_sq_test;
1380 best.base_index = base_index;
1381 best.ele =
reinterpret_cast<BMElem *
>(
e);
1401 mul_m4_v3(obedit->object_to_world().ptr(), point);
1403 ray_origin, ray_direction, point);
1404 if (dist_sq_test < dist_sq_best_face) {
1405 dist_sq_best_face = dist_sq_test;
1406 best_face.base_index = base_index;
1407 best_face.ele =
reinterpret_cast<BMElem *
>(f);
1409 if (dist_sq_test < dist_sq_best) {
1410 dist_sq_best = dist_sq_test;
1411 best.base_index = base_index;
1412 best.ele =
reinterpret_cast<BMElem *
>(f);
1419 *r_base_index_vert = best_vert.base_index;
1420 *r_base_index_edge = best_edge.base_index;
1421 *r_base_index_face = best_face.base_index;
1433 if (best_vert.ele) {
1434 *r_eve =
reinterpret_cast<BMVert *
>(best_vert.ele);
1436 if (best_edge.ele) {
1437 *r_eed =
reinterpret_cast<BMEdge *
>(best_edge.ele);
1439 if (best_face.ele) {
1440 *r_efa =
reinterpret_cast<BMFace *
>(best_face.ele);
1443 return (best_vert.ele !=
nullptr || best_edge.ele !=
nullptr || best_face.ele !=
nullptr);
1456 bool changed =
false;
1459 int (*group_index)[2];
1474 for (i = 0; i < group_tot; i++) {
1475 ListBaseT<LinkData> faces_regions;
1478 const int fg_sta = group_index[i][0];
1479 const int fg_len = group_index[i][1];
1483 for (j = 0; j < fg_len; j++) {
1494 while (
BMFace *f = *(faces++)) {
1505 MEM_delete(groups_array);
1506 MEM_delete(group_index);
1523 ot->
name =
"Select Similar Regions";
1524 ot->
idname =
"MESH_OT_select_similar_region";
1525 ot->
description =
"Select similar face regions to the current selection";
1596 "Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection");
1599 "Edge select - Shift-Click for multiple modes, "
1600 "Ctrl-Click expands/contracts selection depending on the current mode");
1602 return TIP_(
"Face select - Shift-Click for multiple modes, Ctrl-Click expands selection");
1614 {0,
"DISABLE",
false,
"Disable",
"Disable the selection mode"},
1615 {1,
"ENABLE",
false,
"Enable",
"Enable the selection mode"},
1616 {2,
"TOGGLE",
false,
"Toggle",
"Toggle the selection mode"},
1617 {0,
nullptr, 0,
nullptr,
nullptr},
1621 ot->
name =
"Select Mode";
1622 ot->
idname =
"MESH_OT_select_mode";
1644 ot->
srna,
"action", actions_items, 2,
"Action",
"Selection action to execute");
1657 int r_count_by_select[2],
1664 r_count_by_select[0] = r_count_by_select[1] = 0;
1682 if (r_count_by_select[0] && r_count_by_select[1]) {
1683 r_count_by_select[0] = r_count_by_select[1] = -1;
1701 bool changed =
false;
1720 if (foreach_elem_fn) {
1721 foreach_elem_fn(ele);
1738 for (
Object *obedit : objects) {
1762 edarray[edindex] = eed;
1767 bool changed =
false;
1768 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1769 eed = edarray[edindex];
1791 MEM_delete(edarray);
1811 for (
Object *obedit : objects) {
1834 edarray[edindex] = eed;
1839 bool changed =
false;
1840 for (edindex = 0; edindex < totedgesel; edindex += 1) {
1841 eed = edarray[edindex];
1850 MEM_delete(edarray);
1869 bool has_selected_boundary_multi =
false;
1873 for (
const int ob_index : objects.
index_range()) {
1874 Object *obedit = objects[ob_index];
1892 object_edges[ob_index].append(eed);
1893 has_selected_boundary_multi =
true;
1898 if (!has_selected_boundary_multi) {
1901 "At least one boundary edge is needed to make a boundary loop selection");
1907 bool changed_multi =
false;
1909 for (
const int ob_index : objects.
index_range()) {
1910 Object *obedit = objects[ob_index];
1914 bool changed =
false;
1915 bool changed_boundary =
false;
1916 if (extend ==
false) {
1921 for (
BMEdge *
e : object_edges[ob_index]) {
1930 changed |= changed_boundary;
1935 if (changed_boundary) {
1941 changed_multi =
true;
1947 if (!changed_multi) {
1950 "The selection has not changed. The full delimited loop was already selected");
1958 ot->
name =
"Multi Select Edge Loops";
1959 ot->
idname =
"MESH_OT_select_edge_loop_multi";
1960 ot->
description =
"Select loops of connected edges from each selected edge";
1971 "delimit_edge_loop",
1975 "Delimit edge loop selection");
1981 ot->
name =
"Multi Select Edge Rings";
1982 ot->
idname =
"MESH_OT_select_edge_ring_multi";
1983 ot->
description =
"Select rings of connected edges from each selected edge";
1994 "delimit_edge_ring",
1997 "Edge Ring Delimit",
1998 "Delimit edge ring selection");
2004 ot->
name =
"Multi Select Boundary Loops";
2005 ot->
idname =
"MESH_OT_select_boundary_loop_multi";
2006 ot->
description =
"Select entire boundary loop of each selected boundary edge";
2018 "delimit_edge_loop",
2022 "Delimit edge loop selection");
2043 bool full_loop =
false;
2047 int count_by_select[2];
2051 if (count_by_select[!
select] == 0) {
2057 if (count_by_select[!
select] == 0) {
2080 bool full_boundary =
false;
2081 bool full_loop =
false;
2086 int count_by_select[2];
2090 if (count_by_select[!
select] == 0) {
2091 full_boundary =
true;
2096 if (count_by_select[!
select] == 0) {
2097 full_boundary =
false;
2102 else if (!non_manifold &&
2105 int count_by_select[2];
2109 if (count_by_select[!
select] == 0) {
2115 if (count_by_select[!
select] == 0) {
2125 if (full_boundary) {
2129 else if (non_manifold) {
2138 else if (full_loop) {
2193 *r_obedit =
nullptr;
2197 vc.
mval[0] = mval[0];
2198 vc.
mval[1] = mval[1];
2201 const short selectmode = em_original->
selectmode;
2210 int base_index = -1;
2213 *r_obedit = bases[base_index]->object;
2219 return eed !=
nullptr;
2234 prop =
RNA_def_boolean(ot->
srna,
"extend",
false,
"Extend Select",
"Extend the selection");
2236 prop =
RNA_def_boolean(ot->
srna,
"deselect",
false,
"Deselect",
"Remove from the selection");
2238 prop =
RNA_def_boolean(ot->
srna,
"toggle",
false,
"Toggle Select",
"Toggle the selection");
2268 *bmain, scene, view_layer,
nullptr);
2269 if (object_index >= bases.
size()) {
2273 Object *obedit = bases[object_index]->object;
2292 bool select_clear =
false;
2293 bool select_cycle =
true;
2295 if (extend ==
false && deselect ==
false && toggle ==
false) {
2296 select_clear =
true;
2302 else if (deselect) {
2310 select_cycle =
false;
2319 for (
Base *base_iter : bases) {
2320 Object *obedit_iter = base_iter->object;
2321 if (obedit_iter == obedit) {
2334 em, obedit, eed,
select, select_clear, select_cycle, ring, delimit);
2381 Object *obedit =
nullptr;
2387 BLI_assert(eed !=
nullptr && obedit !=
nullptr);
2398 *bmain, scene, view_layer,
nullptr);
2399 int object_index = -1;
2401 if (bases[i]->
object == obedit) {
2418 const bool select = extend || (!deselect && !toggle);
2431 float v1_co[2], v2_co[2];
2447 BMVert *
v = (length_1 < length_2) ? eed->
v1 : eed->
v2;
2452 BMFace *f, *efa =
nullptr;
2465 if (tdist < best_dist) {
2493 "delimit_edge_loop";
2508 "delimit_edge_ring";
2527 if (
STREQ(prop_id,
"delimit_edge_loop")) {
2532 if (
STREQ(prop_id,
"delimit_face_loop")) {
2548 if (
STREQ(prop_id,
"delimit_edge_ring")) {
2553 if (
STREQ(prop_id,
"delimit_face_loop")) {
2563 ot->
name =
"Loop Select";
2564 ot->
idname =
"MESH_OT_loop_select";
2565 ot->
description =
"Select a loop of connected edges";
2580 "delimit_edge_loop",
2584 "Delimit edge loop selection");
2587 "delimit_face_loop",
2590 "Face Loop Delimit",
2591 "Delimit face loop selection");
2599 ot->
name =
"Edge Ring Select";
2600 ot->
idname =
"MESH_OT_edgering_select";
2614 "delimit_edge_ring",
2617 "Edge Ring Delimit",
2618 "Delimit edge ring selection");
2621 "delimit_face_loop",
2624 "Face Loop Delimit",
2625 "Delimit face loop selection");
2648 for (
Object *obedit : objects) {
2657 for (
Object *obedit : objects) {
2683 ot->
name =
"(De)select All";
2684 ot->
idname =
"MESH_OT_select_all";
2685 ot->
description =
"(De)select all vertices, edges or faces";
2711 for (
Object *obedit : objects) {
2727 ot->
name =
"Select Interior Faces";
2728 ot->
idname =
"MESH_OT_select_interior_faces";
2729 ot->
description =
"Select faces where all edges have more than 2 face users";
2750 int base_index_active = -1;
2757 vc.
mval[0] = mval[0];
2758 vc.
mval[1] = mval[1];
2763 bool changed =
false;
2768 (eed ?
reinterpret_cast<BMElem *
>(eed) :
reinterpret_cast<BMElem *
>(eve));
2774 for (
Base *base_iter : bases) {
2775 Object *ob_iter = base_iter->object;
2786 Base *basact = bases[base_index_active];
3000 nextese = ese->
next;
3010 nextese = ese->
next;
3020 nextese = ese->
next;
3036 const short selectmode_prev = em->
selectmode;
3208 const short selectmode_toggle,
3210 const bool use_extend,
3211 const bool use_expand)
3220 short selectmode_new;
3230 if (em ==
nullptr) {
3237 const short selectmode_old = selectmode_new;
3239 bool only_update =
false;
3246 if ((selectmode_old & selectmode_toggle) == 0) {
3251 if (selectmode_old == selectmode_toggle) {
3255 selectmode_new &= ~selectmode_toggle;
3259 if ((selectmode_old & selectmode_toggle) != 0) {
3263 selectmode_new |= selectmode_toggle;
3267 if (selectmode_old == selectmode_toggle) {
3271 selectmode_new ^= selectmode_toggle;
3283 for (
Object *ob_iter : objects) {
3302 bool use_uv_select_ensure =
false;
3309 use_uv_select_ensure =
true;
3313 if (use_extend ==
false || selectmode_new == 0) {
3316 for (
Object *ob_iter : objects) {
3323 use_uv_select_ensure =
false;
3327 switch (selectmode_toggle) {
3329 if (use_extend ==
false || selectmode_new == 0) {
3335 if (use_extend ==
false || selectmode_new == 0) {
3341 if (use_extend ==
false || selectmode_new == 0) {
3353 for (
Object *ob_iter : objects) {
3357 if (use_uv_select_ensure) {
3382 bool changed =
false;
3383 bool changed_toolsettings =
false;
3387 changed_toolsettings =
true;
3390 for (
Object *ob_iter : objects) {
3402 if (changed_toolsettings) {
3407 return changed || changed_toolsettings;
3444 if (objects.
size() <= 1) {
3448 bool changed =
false;
3450 for (
Object *obedit : objects) {
3469 const short selectmode_disable,
3470 const short selectmode_fallback)
3475 const short selectmode = (em->
selectmode == selectmode_disable) ?
3476 selectmode_fallback :
3498 bool changed =
false;
3513 if (use_uv_select) {
3522 const int cd_loop_uv_offset = use_uv_select ?
3525 if (cd_loop_uv_offset == -1) {
3592 bool changed_multi =
false;
3593 for (
Base *base_iter : bases) {
3594 Object *ob_iter = base_iter->object;
3603 changed_multi =
true;
3605 return changed_multi;
3619 const short selectmode_disable,
3620 const short selectmode_fallback)
3622 bool changed_multi =
false;
3623 for (
Base *base_iter : bases) {
3624 Object *ob_iter = base_iter->object;
3628 changed_multi =
true;
3631 return changed_multi;
3635 const short selectmode_disable,
3636 const short selectmode_fallback)
3683 if (!
ELEM(i, -1, face_index)) {
3684 if (loop_index == 2) {
3687 r_l_pair[loop_index++] = l_iter;
3690 return (loop_index == 2);
3706 area += f_link.area;
3709 BMLoop *l_iter, *l_first;
3713 float cost_test = 0.0f;
3716 BMLoop *l_radial_iter = l_iter;
3719 if (!
ELEM(i_other, -1, i)) {
3735 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
3737 if (cost_count >= 2) {
3742 }
while ((l_iter = l_iter->
next) != l_first);
3744 return found ? cost / area :
FLT_MAX;
3750 bool changed =
false;
3755 bool has_nonmanifold =
false;
3762 has_nonmanifold =
true;
3767 edge_lengths[i] = -1.0;
3774 if (has_nonmanifold ==
false) {
3775 MEM_delete(edge_lengths);
3781 int (*fgroup_index)[2];
3806 for (
int i = 0; i < fgroup_len; i++) {
3807 const int fg_sta = fgroup_index[i][0];
3808 const int fg_len = fgroup_index[i][1];
3809 for (
int j = 0; j < fg_len; j++) {
3810 const int face_index = fgroup_array[fg_sta + j];
3814 BMFaceLink *f_link = &f_link_array[face_index];
3821 MEM_delete(fgroup_array);
3822 MEM_delete(fgroup_index);
3828 for (
int i = 0; i < fgroup_len; i++) {
3834 fgroup_table[i] =
nullptr;
3846#define USE_DELAY_FACE_GROUP_COST_CALC
3850#if defined(USE_DELAY_FACE_GROUP_COST_CALC)
3854 if (fgroup_dirty[i]) {
3864 fgroup_table[i] =
nullptr;
3866 fgroup_dirty[i] =
false;
3881 fgroup_table[i_min] =
nullptr;
3885 BMFace *f = f_link->face;
3889 BMLoop *l_iter, *l_first;
3905 std::swap(i_a, i_b);
3918 fgroup_table[i_b] =
nullptr;
3923 if (fgroup_dirty[i_a] ==
false) {
3926 fgroup_dirty[i_a] =
true;
3933 if (l_radial_iter != l_iter) {
3936 if (!
ELEM(i_other, -1, i_min)) {
3937 if ((fgroup_table[i_other] !=
nullptr) && (fgroup_dirty[i_other] ==
false)) {
3938#if !defined(USE_DELAY_FACE_GROUP_COST_CALC)
3941 fgroup_dirty[i_other] =
true;
3944 }
while ((l_radial_iter = l_radial_iter->
radial_next) != l_iter);
3947 }
while ((l_iter = l_iter->
next) != l_first);
3951 const int i = fgroup_recalc_stack[
index];
3952 if (fgroup_table[i] !=
nullptr && fgroup_dirty[i] ==
true) {
3960 fgroup_table[i] =
nullptr;
3963 fgroup_dirty[i] =
false;
3968 MEM_delete(edge_lengths);
3969 MEM_delete(f_link_array);
3970 MEM_delete(fgroup_listbase);
3971 MEM_delete(fgroup_recalc_stack);
3972 MEM_delete(fgroup_table);
3973 MEM_delete(fgroup_dirty);
3989#define USE_LINKED_SELECT_DEFAULT_HACK
4019 if (
e->l &&
e->l->radial_next !=
e->l) {
4020 const short mat_nr =
e->l->f->mat_nr;
4021 BMLoop *l_iter =
e->l->radial_next;
4023 if (l_iter->
f->
mat_nr != mat_nr) {
4032 e, delimit_data->cd_loop_type, delimit_data->cd_loop_offset) == 0)
4041#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4050 char *delimit_last = &delimit_last_store[delimit_last_index];
4056 *delimit_last = delimit;
4059 delimit = *delimit_last;
4077 DelimitData delimit_data{};
4082 if (delimit_data.cd_loop_offset == -1) {
4113#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4123 for (
Object *obedit : objects) {
4129 int delimit = delimit_init;
4321 ot->
name =
"Select Linked All";
4322 ot->
idname =
"MESH_OT_select_linked";
4323 ot->
description =
"Select all vertices connected to the current selection";
4337 "Delimit selected region");
4338#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4354 BMesh *
bm,
const short selectmode,
BMElem *ele,
bool sel,
int delimit)
4381 BMW_ITER (ele_walk, &walker, eve) {
4419 BMW_ITER (ele_walk, &walker, eed) {
4477 Base *basact =
nullptr;
4498 bool has_edges =
false;
4499 for (
Base *base : bases) {
4500 Object *ob_iter = base->object;
4507 if (has_edges ==
false) {
4512 vc.
mval[0] =
event->mval[0];
4513 vc.
mval[1] =
event->mval[1];
4519 int base_index = -1;
4524 basact = bases[base_index];
4533 if (em->
selectmode != active_selectmode) [[unlikely]] {
4537#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4568 Object *obedit =
nullptr;
4581 if (ele ==
nullptr) {
4589#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4608 ot->
name =
"Select Linked";
4609 ot->
idname =
"MESH_OT_select_linked_pick";
4610 ot->
description =
"(De)select all vertices linked to the edge under the mouse cursor";
4626 "Delimit selected region");
4627#ifdef USE_LINKED_SELECT_DEFAULT_HACK
4656 for (
Object *obedit : objects) {
4659 bool changed =
false;
4679 if (exclude_nonmanifold) {
4688 bool all_edges_manifold =
true;
4691 all_edges_manifold =
false;
4696 if (all_edges_manifold ==
false) {
4744 ot->
name =
"Select By Pole Count";
4746 "Select vertices at poles by the number of connected edges. "
4747 "In edge and face mode the geometry connected to the vertices is selected";
4748 ot->
idname =
"MESH_OT_select_by_pole_count";
4764 "Type of comparison to make");
4767 ot->
srna,
"exclude_nonmanifold",
true,
"Exclude Non Manifold",
"Exclude non-manifold poles");
4787 for (
Object *obedit : objects) {
4790 bool changed =
false;
4827 ot->
name =
"Select Faces by Sides";
4828 ot->
description =
"Select vertices or faces by the number of face sides";
4829 ot->
idname =
"MESH_OT_select_face_by_sides";
4845 "Type of comparison to make");
4865 for (
Object *obedit : objects) {
4870 bool changed =
false;
4911 bool is_loose =
true;
4940 ot->
name =
"Select Loose Geometry";
4941 ot->
description =
"Select loose geometry based on the selection mode";
4942 ot->
idname =
"MESH_OT_select_loose";
4970 const int select_mode = bm_active->
selectmode;
4971 int tot_mirr = 0, tot_fail = 0;
4976 for (
Object *obedit : objects) {
4983 int tot_mirr_iter = 0, tot_fail_iter = 0;
4985 for (
int axis = 0; axis < 3; axis++) {
4986 if ((1 << axis) & axis_flag) {
4988 em, id_cast<Mesh *>(obedit->data), axis, extend, &tot_mirr_iter, &tot_fail_iter);
4992 if (tot_mirr_iter) {
5000 tot_fail += tot_fail_iter;
5001 tot_mirr += tot_mirr_iter;
5004 if (tot_mirr || tot_fail) {
5013 ot->
name =
"Select Mirror";
5014 ot->
description =
"Select mesh items at mirrored locations";
5015 ot->
idname =
"MESH_OT_select_mirror";
5045 for (
Object *obedit : objects) {
5063 ot->
name =
"Select More";
5064 ot->
idname =
"MESH_OT_select_more";
5065 ot->
description =
"Select more vertices, edges or faces connected to initial selection";
5075 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
5093 for (
Object *obedit : objects) {
5111 ot->
name =
"Select Less";
5112 ot->
idname =
"MESH_OT_select_less";
5113 ot->
description =
"Deselect vertices, edges or faces at the boundary of each selection region";
5123 ot->
srna,
"use_face_step",
true,
"Face Step",
"Connected faces (instead of edges)");
5156 BMEdge *e_other, *e_next =
nullptr;
5158 const int count_expected = 1;
5164 if (++count > count_expected) {
5169 return (count == count_expected) ? e_next :
nullptr;
5176 BMVert *v_next =
nullptr;
5178 const int count_expected = v_prev ? 1 : 2;
5185 if (++count > count_expected) {
5190 return (count == count_expected) ? v_next :
nullptr;
5198 BMFace *f_next =
nullptr;
5200 const int count_expected = f_prev ? 1 : 2;
5209 if (++count > count_expected) {
5215 return (count == count_expected) ? f_next :
nullptr;
5223 BMVert *v_prev =
nullptr, *v_curr = v_start;
5226 int selected_neighbor_count = 0;
5232 if (++selected_neighbor_count > 2) {
5237 if (selected_neighbor_count != 2) {
5242 if (v_next ==
nullptr) {
5247 }
while (v_curr != v_start);
5257 BMEdge *e_curr = e_start;
5262 if (e_next ==
nullptr) {
5268 }
while (e_curr != e_start);
5278 BMFace *f_prev =
nullptr;
5279 BMFace *f_curr = f_start;
5282 int selected_neighbor_count = 0;
5291 selected_neighbor_count++;
5295 if (selected_neighbor_count != 2) {
5300 if (f_next ==
nullptr) {
5306 }
while (f_curr != f_start);
5315 BMVert *v_prev =
nullptr;
5316 BMVert *v_curr = v_start;
5333 if (
ELEM(v_next,
nullptr, v_start)) {
5347 BMEdge *e_curr = e_start;
5365 if (
ELEM(e_next,
nullptr, e_start)) {
5379 BMFace *f_prev =
nullptr;
5380 BMFace *f_curr = f_start;
5396 if (
ELEM(f_next,
nullptr, f_start)) {
5414 int walktype = 0, itertype = 0, flushtype = 0;
5415 short mask_vert = 0, mask_edge = 0, mask_face = 0;
5418 if (h_act ==
nullptr) {
5458 switch (h_act->
htype) {
5511 for (ele =
static_cast<BMElem *
>(
BMW_begin(&walker, h_act)); ele !=
nullptr;
5547 *r_eve =
reinterpret_cast<BMVert *
>(ele);
5550 *r_eed =
reinterpret_cast<BMEdge *
>(ele);
5553 *r_efa =
reinterpret_cast<BMFace *
>(ele);
5586 const short selectmode,
5618 bool found_active_elt =
false;
5623 for (
Object *obedit : objects) {
5633 found_active_elt =
true;
5638 EDBM_update(id_cast<Mesh *>(obedit->data), ¶ms);
5642 if (!found_active_elt) {
5653 ot->
name =
"Checker Deselect";
5654 ot->
idname =
"MESH_OT_select_nth";
5655 ot->
description =
"Deselect every Nth element starting from the active vertex, edge or face";
5697 for (
Object *obedit : objects) {
5713 if (angle_cos < angle_limit_cos) {
5740 ot->
name =
"Select Sharp Edges";
5741 ot->
description =
"Select all sharp enough edges";
5742 ot->
idname =
"MESH_OT_edges_select_sharp";
5780 for (
Object *obedit : objects) {
5788 BMIter iter, liter, liter2;
5819 if (angle_cos > angle_limit_cos) {
5840 ot->
name =
"Select Linked Flat Faces";
5842 ot->
idname =
"MESH_OT_faces_select_linked_flat";
5888 for (
Object *obedit : objects) {
5895 bool changed =
false;
5916 if (use_wire || use_boundary || use_multi_face || use_non_contiguous) {
5949 ot->
name =
"Select Non-Manifold";
5950 ot->
description =
"Select all non-manifold vertices or edges";
5951 ot->
idname =
"MESH_OT_select_non_manifold";
5966 ot->
srna,
"use_multi_face",
true,
"Multiple Faces",
"Edges shared by more than two faces");
5968 "use_non_contiguous",
5971 "Edges between faces pointing in alternate directions");
5974 ot->
srna,
"use_verts",
true,
"Vertices",
"Vertices connecting multiple face regions");
5995 for (
const int ob_index : objects.
index_range()) {
5996 Object *obedit = objects[ob_index];
6000 int seed_iter = seed;
6008 int elem_map_len = 0;
6013 elem_map[elem_map_len++] = eve;
6018 const int count_select = elem_map_len * randfac;
6019 for (
int i = 0; i < count_select; i++) {
6022 MEM_delete(elem_map);
6025 int elem_map_len = 0;
6030 elem_map[elem_map_len++] = eed;
6034 const int count_select = elem_map_len * randfac;
6035 for (
int i = 0; i < count_select; i++) {
6038 MEM_delete(elem_map);
6041 int elem_map_len = 0;
6046 elem_map[elem_map_len++] = efa;
6050 const int count_select = elem_map_len * randfac;
6051 for (
int i = 0; i < count_select; i++) {
6054 MEM_delete(elem_map);
6076 ot->
name =
"Select Random";
6078 ot->
idname =
"MESH_OT_select_random";
6109 else if (defbase->is_empty() || cd_dvert_offset == -1) {
6129 for (
Object *obedit : objects) {
6134 if (cd_dvert_offset == -1) {
6141 bool changed =
false;
6154 if (
ELEM(
nullptr, dv, dv->
dw)) {
6175 ot->
name =
"Select Ungrouped";
6176 ot->
idname =
"MESH_OT_select_ungrouped";
6177 ot->
description =
"Select vertices without a group";
6213 if (v_act ==
nullptr) {
6215 op->
reports,
RPT_WARNING,
"This operator requires an active vertex (last selected)");
6222 float axis_mat[3][3];
6236 const float *axis_vector = axis_mat[axis];
6239 float vertex_world[3];
6240 mul_v3_m4v3(vertex_world, obedit->object_to_world().ptr(), v_act->
co);
6241 value =
dot_v3v3(axis_vector, vertex_world);
6253 for (
Object *obedit_iter : objects) {
6263 bool changed =
false;
6267 float v_iter_world[3];
6268 mul_v3_m4v3(v_iter_world, obedit_iter->object_to_world().ptr(),
v->
co);
6269 const float value_iter =
dot_v3v3(axis_vector, v_iter_world);
6272 if (
fabsf(value_iter - value) < limit) {
6278 if (value_iter < value) {
6284 if (value_iter > value) {
6309 {0,
nullptr, 0,
nullptr,
nullptr},
6313 ot->
name =
"Select Axis";
6314 ot->
description =
"Select all data in the mesh on a single axis";
6315 ot->
idname =
"MESH_OT_select_axis";
6330 "Axis orientation");
6337 "Select the axis to compare each vertex on");
6339 ot->
srna,
"threshold", 0.0001f, 0.000001f, 50.0f,
"Threshold",
"", 0.00001f, 10.0f);
6355 bool changed =
false;
6356 for (
Object *obedit : objects) {
6372 int tot = 0, totsel = 0;
6379 if ((tot != totsel && totsel > 0) || (totsel == 1 && tot == 1)) {
6411 ot->
name =
"Select Boundary of Selected";
6412 ot->
idname =
"MESH_OT_region_to_loop";
6413 ot->
description =
"Select boundary edges around the selected faces";
6438 visit_face_set.
add(
l->
f);
6459 if (visit_face_set.
add(l2->
f)) {
6467 memcpy(region_alloc, region.
data(), region.
as_span().size_in_bytes());
6468 *region_out = region_alloc;
6469 return region.
size();
6474 const BMEdge *e_a = *(
static_cast<const BMEdge **
>(
const_cast<void *
>(va)));
6475 const BMEdge *e_b = *(
static_cast<const BMEdge **
>(
const_cast<void *
>(vb)));
6517 qsort(edges, edges_len,
sizeof(*edges),
verg_radial);
6519 for (i = 0; i < edges_len; i++) {
6522 BMFace **region =
nullptr, **region_out;
6538 if (!region || (selbigger ? c >= tot : c < tot)) {
6546 region = region_out;
6550 MEM_delete(region_out);
6557 for (j = 0; j < tot; j++) {
6584 for (
Object *obedit : objects) {
6603 bool changed =
true;
6630 ot->
name =
"Select Loop Inner-Region";
6631 ot->
idname =
"MESH_OT_loop_to_region";
6632 ot->
description =
"Select region of faces inside of a selected loop of edges";
6645 "Select bigger regions instead of smaller ones");
6654 const Mesh *
mesh = id_cast<const Mesh *>(obedit->
data);
6669 C,
"The active attribute must be on the vertex, edge, or face domain");
6685 return std::nullopt;
6696 for (
Object *obedit : objects) {
6697 Mesh *
mesh = id_cast<Mesh *>(obedit->data);
6720 bool changed =
false;
6747 ot->
name =
"Select by Attribute";
6748 ot->
idname =
"MESH_OT_select_by_attribute";
6749 ot->
description =
"Select elements based on the active boolean attribute";
Generic geometry attributes built on CustomData.
CustomData interface, see also DNA_customdata_types.h.
General operations, lookup, etc. for blender objects.
A min-heap / priority queue ADT.
#define STACK_CLEAR(stack)
#define STACK_PUSH(stack, val)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
Object is a sort of wrapper for general info.
#define RV3D_CLIPPING_ENABLED(v3d, rv3d)
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT
#define V3D_PROJ_TEST_CLIP_DEFAULT
#define XRAY_FLAG_ENABLED(v3d)
Read Blender memory allocation and freeing.
#define UNUSED_FUNCTION(x)
#define BLI_assert_unreachable()
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#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)
#define BM_select_history_store(bm, ele)
#define BM_select_history_remove(bm, ele)
#define BMO_edge_flag_test(bm, e, oflag)
#define BMO_edge_flag_set(bm, e, oflag, val)
#define BMO_elem_flag_enable(bm, ele, oflag)
#define BM_edge_face_count_is_over(e, n)
#define BMW_ITER(ele, walker, data)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
static AttributeOwner from_id(ID *id)
static std::optional< EditMeshSymmetryHelper > create_if_needed(Object *ob, uchar htype)
bool contains(const Key &key) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
void append(const T &value)
IndexRange index_range() const
void reserve(const int64_t min_capacity)
Span< T > as_span() const
#define FIND_NEAR_SELECT_BIAS
#define FIND_NEAR_CYCLE_THRESHOLD_MIN
void base_activate(bContext *C, Base *base)
bool material_active_index_set(Object *ob, int index)
MINLINE float min_ff(float a, float b)
void WM_main_add_notifier(uint type, void *reference)
void EDBM_flag_disable_all(BMesh *bm, char hflag)
std::optional< StringRefNull > BKE_attributes_active_name_get(AttributeOwner &owner)
void BM_edge_uvselect_set_pick(BMesh *bm, BMEdge *e, bool select, const BMUVSelectPickParams ¶ms)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
BMElem * EDBM_elem_from_selectmode(BMEditMesh *em, BMVert *eve, BMEdge *eed, BMFace *efa)
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void ED_uvedit_sync_uvselect_ensure_if_needed(const ToolSettings *ts, BMesh *bm)
bool EDBM_deselect_by_material(BMesh *bm, short index, bool select)
static wmOperatorStatus edbm_select_face_by_sides_exec(bContext *C, wmOperator *op)
const Mesh * BKE_object_get_editmesh_eval_cage(const Object *object)
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
bool EDBM_mesh_deselect_all_multi_ex(Span< Base * > bases)
static wmOperatorStatus edbm_select_linked_pick_exec(bContext *C, wmOperator *op)
int BM_edge_face_count(const BMEdge *e)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
const EnumPropertyItem rna_enum_mesh_select_mode_items[]
bool BM_face_is_any_vert_flag_test(const BMFace *f, const char hflag)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int RNA_enum_get(PointerRNA *ptr, const char *name)
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 BM_mesh_elem_toolflags_ensure(BMesh *bm)
bool EDBM_select_pick(bContext *C, const int mval[2], const SelectPick_Params ¶ms)
static wmOperatorStatus edbm_select_loop_or_ring_exec_impl(bContext *C, wmOperator *op, bool ring, BMWDelimitFlag delimit)
static void mouse_mesh_loop_face(BMesh *bm, BMEdge *eed, bool select, bool select_clear, BMWDelimitFlag delimit)
static wmOperatorStatus edbm_select_mode_exec(bContext *C, wmOperator *op)
static void edbm_strip_selections(BMesh *bm, const short selectmode)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
bool BM_mesh_uvselect_clear(BMesh *bm)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void EDBM_selectmode_flush(BMesh *bm, short selectmode)
void EDBM_select_more(BMesh *bm, short selectmode, bool use_face_step)
static wmOperatorStatus edbm_select_ring_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const ListBaseT< bDeformGroup > * BKE_object_defgroup_list(const Object *ob)
static wmOperatorStatus edbm_faces_select_interior_exec(bContext *C, wmOperator *)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void WM_operator_properties_select_random(wmOperatorType *ot)
static BMEdge * bm_step_over_vert_to_next_selected_edge_in_chain(const BMEdge *e_curr, BMVert *v)
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
HeapNode * BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static bool edbm_select_ring_poll_property(const bContext *C, wmOperator *, const PropertyRNA *prop)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
int BM_mesh_region_match(BMesh *bm, BMFace **faces_region, uint faces_region_len, ListBaseT< LinkData > *r_face_regions)
static void select_linked_delimit_begin(BMesh *bm, int delimit)
const EnumPropertyItem rna_enum_mesh_walk_delimit_face_loop_items[]
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void MESH_OT_select_by_pole_count(wmOperatorType *ot)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
static bool edbm_selectmode_sync_multi_ex(Span< Object * > objects)
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
BMVert * EDBM_verts_mirror_get(BMEditMesh *em, BMesh *bm, BMVert *v)
void * BMW_begin(BMWalker *walker, void *start)
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
@ BMW_EDGELOOP_NONMANIFOLD
void BM_mesh_uvselect_mode_flush_only_select(BMesh *bm)
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
static wmOperatorStatus edbm_select_loose_exec(bContext *C, wmOperator *op)
static void walker_deselect_nth_face_chain(BMesh *bm, const CheckerIntervalParams *op_params, BMFace *f_start)
static void select_linked_delimit_end(BMesh *bm)
void MESH_OT_select_more(wmOperatorType *ot)
static std::string edbm_select_mode_get_description(bContext *, wmOperatorType *, PointerRNA *ptr)
const char * RNA_property_identifier(const PropertyRNA *prop)
void mul_v3_m4v3(float r[3], const float mat[4][4], const float vec[3])
bool EDBM_selectmode_disable(Scene *scene, BMEditMesh *em, BMesh *bm, short selectmode_disable, short selectmode_fallback)
MINLINE void copy_v2_v2(float r[2], const float a[2])
void MESH_OT_select_less(wmOperatorType *ot)
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_verts_mirror_get_edge(BMEditMesh *em, BMesh *bm, BMEdge *e)
int WM_operator_properties_select_random_seed_increment_get(wmOperator *op)
void BMW_init(BMWalker *walker, BMesh *bm, int type, short mask_vert, short mask_edge, short mask_face, BMWFlag flag, int layer, BMWDelimitFlag delimit)
Initialize Walker.
void MESH_OT_loop_select(wmOperatorType *ot)
BMVert * EDBM_vert_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan_p, bool use_select_bias, bool use_cycle, Span< Base * > bases, uint *r_base_index)
BMVert * BM_vert_at_index_find_or_table(BMesh *bm, const int index)
void EDBM_update(Mesh *mesh, const EDBMUpdate_Params *params)
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
static wmOperatorStatus edbm_loop_to_region_exec(bContext *C, wmOperator *op)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
bool DRW_select_buffer_elem_get(uint sel_id, uint &r_elem, uint &r_base_index, char &r_elem_type)
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)
const EnumPropertyItem rna_enum_axis_flag_xyz_items[]
bool BM_edge_is_any_face_flag_test(const BMEdge *e, const char hflag)
void MESH_OT_select_edge_ring_multi(wmOperatorType *ot)
void EDBM_select_mirrored(BMEditMesh *em, Mesh *mesh, int axis, bool extend, int *r_totmirr, int *r_totfail)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void MESH_OT_select_ungrouped(wmOperatorType *ot)
static void edbm_select_linked_pick_ex(BMesh *bm, const short selectmode, BMElem *ele, bool sel, int delimit)
void MESH_OT_select_axis(wmOperatorType *ot)
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
bool BM_face_is_any_edge_flag_test(const BMFace *f, const char hflag)
void void void BLI_movelisttolist(ListBase *dst, ListBase *src) ATTR_NONNULL(1
int RNA_int_get(PointerRNA *ptr, const char *name)
static void find_nearest_face_center__doZBuf(void *user_data, BMFace *efa, const float screen_co[2], int)
void view3d_operator_needs_gpu(const bContext *C)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
static wmOperatorStatus edbm_select_ring_exec(bContext *C, wmOperator *op)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
bool BM_vert_is_all_face_flag_test(const BMVert *v, const char hflag, const bool respect_hide)
static void select_linked_delimit_validate(BMesh *bm, int *delimit)
void EDBM_selectmode_convert(BMesh *bm, short selectmode_old, short selectmode_new)
static bool bm_faces_form_cyclic_chain(BMFace *f_start)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static void edbm_select_loop_or_ring_properties(wmOperatorType *ot)
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable)
void MESH_OT_select_interior_faces(wmOperatorType *ot)
void EDBM_verts_mirror_cache_begin(BMEditMesh *em, BMesh *bm, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology)
BMVert * EDBM_vert_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
bool EDBM_selectmode_toggle_multi(bContext *C, short selectmode_toggle, int action, bool use_extend, bool use_expand)
static const EnumPropertyItem elem_count_compare_items[]
BMElem * EDBM_elem_from_index_any_multi(const Main &bmain, const Scene *scene, ViewLayer *view_layer, uint object_index, uint elem_index, Object **r_obedit)
float BM_edge_calc_length(const BMEdge *e)
int BM_vert_edge_count_at_most(const BMVert *v, const int count_max)
static bool bm_interior_loop_filter_fn(const BMLoop *l, void *)
void MEM_delete_void(void *vmemh)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
uint DRW_select_buffer_sample_point(Depsgraph *depsgraph, ARegion *region, View3D *v3d, const int center[2])
static wmOperatorStatus edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void BM_vert_uvselect_set_pick(BMesh *bm, BMVert *v, bool select, const BMUVSelectPickParams ¶ms)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
static bool bm_edge_is_select_isolated(BMEdge *e)
ViewLayer * CTX_data_view_layer(const bContext *C)
static void deselect_nth_active(BMesh *bm, const short selectmode, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
void WM_operator_properties_select_all(wmOperatorType *ot)
bool EDBM_selectmode_set_multi(bContext *C, short selectmode)
static int select_linked_delimit_default_from_op(wmOperator *op, const int select_mode)
void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_num, unsigned int seed)
const EnumPropertyItem rna_enum_mesh_walk_delimit_edge_ring_items[]
void MESH_OT_select_linked_pick(wmOperatorType *ot)
static wmOperatorStatus edbm_select_loop_or_ring_invoke_impl(bContext *C, wmOperator *op, const wmEvent *event)
MINLINE int bitscan_forward_i(int a)
static bool bm_interior_edge_is_manifold_except_face_index(BMEdge *e, int face_index, BMLoop *r_l_pair[2])
void RNA_def_property_float_default(PropertyRNA *prop, float value)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
void BMO_push(BMesh *bm, BMOperator *op)
BMESH OPSTACK PUSH.
static bool edbm_vert_or_edge_select_mode_poll(bContext *C)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
void BM_face_calc_center_median_vcos(const BMesh *bm, const BMFace *f, float r_cent[3], const Span< float3 > vert_positions)
static wmOperatorStatus edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void mul_m4_v3(const float M[4][4], float r[3])
static wmOperatorStatus edbm_select_by_attribute_exec(bContext *C, wmOperator *)
bool EDBM_selectmode_disable_multi(bContext *C, short selectmode_disable, short selectmode_fallback)
bool ED_operator_editmesh(bContext *C)
static void walker_deselect_nth_vertex_chain(BMesh *bm, const CheckerIntervalParams *op_params, BMVert *v_start)
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
void BM_mesh_uvselect_mode_flush_update(BMesh *bm, const short selectmode_old, const short selectmode_new, const int cd_loop_uv_offset)
static wmOperatorStatus edbm_select_axis_exec(bContext *C, wmOperator *op)
void MESH_OT_select_mirror(wmOperatorType *ot)
void DRW_select_buffer_context_create(Depsgraph *depsgraph, Span< Base * > bases, short select_mode)
float BM_face_calc_area(const BMFace *f)
bool EDBM_unified_findnearest(ViewContext *vc, Span< Base * > bases, int *r_base_index, BMVert **r_eve, BMEdge **r_eed, BMFace **r_efa)
void BMW_end(BMWalker *walker)
End Walker.
static void walker_select_count(BMesh *bm, int walkercode, void *start, int r_count_by_select[2], BMWFlag flags, BMWDelimitFlag delimit)
void DEG_id_tag_update(ID *id, unsigned int flags)
void BM_mesh_active_face_set(BMesh *bm, BMFace *f)
void BKE_report(ReportList *reports, eReportType type, const char *message)
BMesh const char void * data
static int loop_find_regions(BMesh *bm, const bool selbigger)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
float line_point_factor_v2(const float p[2], const float l1[2], const float l2[2])
const EnumPropertyItem rna_enum_mesh_walk_delimit_edge_loop_items[]
void MESH_OT_loop_to_region(wmOperatorType *ot)
BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
static wmOperatorStatus edbm_select_nth_exec(bContext *C, wmOperator *op)
BMFace * EDBM_verts_mirror_get_face(BMEditMesh *em, BMesh *bm, BMFace *f)
bool WM_operator_properties_checker_interval_test(const CheckerIntervalParams *op_params, int depth)
Object * CTX_data_edit_object(const bContext *C)
static void findnearestface__doClosest(void *user_data, BMFace *efa, const float screen_co[2], int index)
void BM_elem_select_set(BMesh *bm, BMElem *ele, const bool select)
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
void MESH_OT_select_face_by_sides(wmOperatorType *ot)
int EDBM_elem_to_index_any_multi(const Main &bmain, const Scene *scene, ViewLayer *view_layer, BMEditMesh *em, BMElem *ele, int *r_object_index)
BMFace * BM_face_at_index_find_or_table(BMesh *bm, const int index)
bool EDBM_select_interior_faces(BMesh *bm)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
static bool edbm_select_loop_poll_property(const bContext *C, wmOperator *, const PropertyRNA *prop)
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
bool BM_vert_is_all_edge_flag_test(const BMVert *v, const char hflag, const bool respect_hide)
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
void MESH_OT_select_by_attribute(wmOperatorType *ot)
static bool edbm_deselect_nth(BMesh *bm, const short selectmode, const CheckerIntervalParams *op_params)
static bool bm_verts_form_cyclic_chain(BMVert *v_start)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool BKE_view_layer_synced_ensure(const Main &bmain, const Scene *scene, ViewLayer *view_layer)
const EnumPropertyItem rna_enum_transform_orientation_items[]
const EnumPropertyItem rna_enum_mesh_delimit_mode_items[]
void MESH_OT_edges_select_sharp(wmOperatorType *ot)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
int BMW_current_depth(BMWalker *walker)
Walker Current Depth.
static void findnearestvert__doClosest(void *user_data, BMVert *eve, const float screen_co[2], int index)
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
void MESH_OT_select_boundary_loop_multi(wmOperatorType *ot)
BMDataLayerLookup BM_data_layer_lookup(const BMesh &bm, const StringRef name)
RegionView3D * CTX_wm_region_view3d(const bContext *C)
ToolSettings * CTX_data_tool_settings(const bContext *C)
MINLINE unsigned short highest_order_bit_s(unsigned short n)
static bool edbm_select_by_attribute_poll(bContext *C)
int BKE_mesh_wrapper_vert_len(const Mesh *mesh)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
static wmOperatorStatus edbm_select_mirror_exec(bContext *C, wmOperator *op)
void MESH_OT_edgering_select(wmOperatorType *ot)
void ED_mesh_report_mirror_ex(ReportList &reports, int totmirr, int totfail, char selectmode)
static void walker_deselect_nth_edge_chain(BMesh *bm, const CheckerIntervalParams *op_params, BMEdge *e_start)
static int loop_find_region(BMLoop *l, int flag, Set< BMFace * > &visit_face_set, BMFace ***region_out)
static wmOperatorStatus edbm_select_by_pole_count_exec(bContext *C, wmOperator *op)
static void edbm_select_loop_or_ring_by_edge(BMEditMesh *em, Object *obedit, BMEdge *eed, bool select, bool select_clear, bool select_cycle, bool ring, BMWDelimitFlag delimit)
BMEdge * EDBM_edge_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
void MESH_OT_select_loose(wmOperatorType *ot)
static std::optional< BMIterType > domain_to_iter_type(const bke::AttrDomain domain)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
BMFace * EDBM_face_find_nearest(ViewContext *vc, float *dist_px_manhattan_p)
void MESH_OT_select_non_manifold(wmOperatorType *ot)
static wmOperatorStatus edbm_boundary_loop_multiselect_exec(bContext *C, wmOperator *op)
static void mouse_mesh_loop_edge(BMesh *bm, BMEdge *eed, bool select, bool select_clear, bool select_cycle, BMWDelimitFlag delimit)
void EDBM_flag_enable_all(BMesh *bm, char hflag)
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)
void MESH_OT_select_edge_loop_multi(wmOperatorType *ot)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
bool EDBM_selectmode_set_multi_ex(Scene *scene, Span< Object * > objects, const short selectmode)
bool invert_m3(float mat[3][3])
static wmOperatorStatus edbm_select_linked_exec(bContext *C, wmOperator *op)
static wmOperatorStatus edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op)
void BM_face_uvselect_set_pick(BMesh *bm, BMFace *f, bool select, const BMUVSelectPickParams ¶ms)
static wmOperatorStatus edbm_select_ungrouped_exec(bContext *C, wmOperator *op)
SpaceImage * CTX_wm_space_image(const bContext *C)
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 em_setup_viewcontext(bContext *C)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
bool BM_edge_loop_pair(BMEdge *e, BMLoop **r_la, BMLoop **r_lb)
MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
static void mouse_mesh_loop_edge_ring(BMesh *bm, BMEdge *eed, bool select, bool select_clear, BMWDelimitFlag delimit)
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)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
void EDBM_verts_mirror_cache_end(BMEditMesh *em)
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local)
void EDBM_selectmode_flush_ex(BMesh *bm, short selectmode)
void EDBM_select_swap(BMEditMesh *em, BMesh *bm)
bool BM_edge_is_all_face_flag_test(const BMEdge *e, const char hflag, const bool respect_hide)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Main * CTX_data_main(const bContext *C)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
BMFace * BM_mesh_active_face_get(BMesh *bm, const bool is_sloppy, const bool is_selected)
void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1
void EDBM_select_toggle_all(BMesh *bm)
static BMElem * edbm_select_id_bm_elem_get(const Span< Base * > bases, const uint sel_id, uint &r_base_index)
BMElem * BM_mesh_active_elem_get(BMesh *bm)
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)
float dist_squared_to_ray_v3_normalized(const float ray_origin[3], const float ray_direction[3], const float co[3])
void interp_v2_v2v2(float r[2], const float a[2], const float b[2], float t)
void MESH_OT_select_linked(wmOperatorType *ot)
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)
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)
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, float dist)
BMEdge * EDBM_edge_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan, float *r_dist_center, bool use_select_bias, bool use_cycle, BMEdge **r_eed_zbuf, Span< Base * > bases, uint *r_base_index)
static wmOperatorStatus edbm_select_all_exec(bContext *C, wmOperator *op)
void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
static float bm_interior_face_group_calc_cost(ListBaseT< BMFaceLink > *ls, const float *edge_lengths)
static void walker_deselect_nth(BMesh *bm, const CheckerIntervalParams *op_params, BMHeader *h_act)
BMFace * EDBM_face_find_nearest_ex(ViewContext *vc, float *dist_px_manhattan, float *r_dist_center, bool use_zbuf_single_px, bool use_select_bias, bool use_cycle, BMFace **r_efa_zbuf, Span< Base * > bases, uint *r_base_index)
static wmOperatorStatus edbm_select_more_exec(bContext *C, wmOperator *op)
@ V3D_PROJ_TEST_CLIP_NEAR
static bool edbm_select_ungrouped_poll(bContext *C)
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
static wmOperatorStatus edbm_select_less_exec(bContext *C, wmOperator *op)
Span< float3 > BKE_mesh_wrapper_vert_coords(const Mesh *mesh)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
void * BMW_step(BMWalker *walker)
Step Walker.
bool ED_operator_editmesh_region_view3d(bContext *C)
const BMesh * BKE_editmesh_bmesh_get(const Object *ob)
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)
Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
static wmOperatorStatus edbm_select_sharp_edges_exec(bContext *C, wmOperator *op)
unsigned int BLI_ghashutil_strhash_p(const void *ptr)
static wmOperatorStatus edbm_select_random_exec(bContext *C, wmOperator *op)
bool EDBM_selectmode_disable_multi_ex(Scene *scene, Span< Base * > bases, short selectmode_disable, short selectmode_fallback)
bool EDBM_uvselect_clear(BMesh *bm)
static wmOperatorStatus edbm_select_loop_exec(bContext *C, wmOperator *op)
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)
static wmOperatorStatus edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
Scene * CTX_data_scene(const bContext *C)
bool WM_cursor_test_motion_and_update(const int mval[2])
static wmOperatorStatus edbm_region_to_loop_exec(bContext *C, wmOperator *)
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)
static BMVert * bm_step_to_next_selected_vert_in_chain(BMVert *v_curr, BMVert *v_prev)
@ OPTYPE_DEPENDS_ON_CURSOR
static int verg_radial(const void *va, const void *vb)
bool EDBM_mesh_deselect_all_multi(bContext *C)
void BM_mesh_select_flush_from_verts(BMesh *bm, const bool select)
void MESH_OT_select_nth(wmOperatorType *ot)
static bool select_linked_delimit_test(BMEdge *e, int delimit, const DelimitData *delimit_data)
BLI_INLINE BMFace * BM_face_at_index(BMesh *bm, const int index)
void MESH_OT_faces_select_linked_flat(wmOperatorType *ot)
static BMFace * bm_step_over_shared_edge_to_next_selected_face_in_chain(BMFace *f_curr, BMFace *f_prev)
bool BM_vert_is_manifold(const BMVert *v)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
static bool walker_select(BMesh *bm, int walkercode, void *start, const bool select, BMWFlag flags, BMWDelimitFlag delimit, FunctionRef< void(BMElem *)> foreach_elem_fn)
static wmOperatorStatus edbm_edge_loop_multiselect_exec(bContext *C, wmOperator *op)
float ED_view3d_select_dist_px()
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
Vector< Base * > BKE_view_layer_array_from_bases_in_edit_mode(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
void EDBM_select_flush_from_verts(BMesh *bm, short selectmode, bool select)
void BM_mesh_uvselect_set_elem_from_mesh(BMesh *bm, const bool select, const BMUVSelectPickParams ¶ms, const VectorList< BMVert * > &verts, const VectorList< BMEdge * > &edges, const VectorList< BMFace * > &faces)
static wmOperatorStatus edbm_edge_ring_multiselect_exec(bContext *C, wmOperator *op)
void MESH_OT_select_all(wmOperatorType *ot)
void BMO_pop(BMesh *bm)
BMESH OPSTACK POP.
static bool is_count_a_match(const eElemCountType type, const int value_test, const int value_reference)
static bool bm_edges_form_cyclic_chain(BMEdge *e_start)
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)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, 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 wmOperatorStatus edbm_select_similar_region_exec(bContext *C, wmOperator *op)
void BM_mesh_elem_toolflags_clear(BMesh *bm)
void MESH_OT_select_mode(wmOperatorType *ot)
void MESH_OT_region_to_loop(wmOperatorType *ot)
void WM_operator_properties_checker_interval_from_op(wmOperator *op, CheckerIntervalParams *op_params)
void MESH_OT_select_random(wmOperatorType *ot)
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)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool BM_edge_is_any_vert_flag_test(const BMEdge *e, const char hflag)
static wmOperatorStatus edbm_select_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
void EDBM_selectmode_set(BMEditMesh *em, BMesh *bm, short selectmode)
BMVert * BM_mesh_active_vert_get(BMesh *bm)
View3D * CTX_wm_view3d(const bContext *C)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
@ BMW_DELIMIT_EDGE_LOOP_OUTER_CORNERS
@ BMW_DELIMIT_EDGE_MARK_SHARP
@ BMW_DELIMIT_EDGE_LOOP_NGONS
@ BMW_DELIMIT_EDGE_MARK_SEAM
@ BMW_DELIMIT_EDGE_RING_NGONS
BMEdge * BM_edge_at_index_find_or_table(BMesh *bm, const int index)
bool BM_edge_is_contiguous_loop_cd(const BMEdge *e, const int cd_loop_type, const int cd_loop_offset)
void MESH_OT_select_similar_region(wmOperatorType *ot)
const EnumPropertyItem rna_enum_axis_xyz_items[]
bool BM_mesh_select_is_mixed(const BMesh *bm)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void * BLI_heap_node_ptr(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void EDBM_select_less(BMesh *bm, short selectmode, bool use_face_step)
void void float BLI_heap_node_value(const HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
static bool edbm_select_loop_or_ring_pick(bContext *C, const int mval[2], Object **r_obedit, BMEdge **r_eed)
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
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
bool uv_select_sync_valid
ListBaseT< BMEditSelection > selected
wmEventModifierFlag modifier
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
bool(*) poll_property(const bContext *C, wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
std::string(*) get_description(bContext *C, wmOperatorType *ot, PointerRNA *ptr)
struct ReportList * reports
struct wmOperatorType * type