86#define PARTIAL_TYPE_MAX 2
139 custom_data->
data =
nullptr;
178#define USE_FACE_SUBSTITUTE
179#ifdef USE_FACE_SUBSTITUTE
180# define FACE_SUBSTITUTE_INDEX INT_MIN
188 BMFace *best_face =
nullptr;
193 BMFace *f_test = l_radial_next->
f;
210 if (best_face ==
nullptr) {
238 }
while ((l_iter = l_iter->
next) != l_first);
242 tcld->
bm_origfaces, cd_face_map, cd_loop_map, f_substitute,
true,
true);
247 *(
reinterpret_cast<BMFace **
>(&f_copy->
no[0])) = f_substitute_copy;
254 return *(
reinterpret_cast<BMFace **
>(&f_copy->
no[0]));
279 for (j = 0; j < l_num; j++) {
285 BMFace *f_copy = BM_face_copy(
286 tcld->bm_origfaces, cd_face_map, cd_loop_map, l->f, true, true);
287#ifdef USE_FACE_SUBSTITUTE
288 if (is_zero_v3(l->f->no)) {
289 mesh_customdatacorrect_face_substitute_set(tcld, l->f, f_copy);
302 loop_weights[j] = 0.0f;
307 if (tcld->use_merge_group) {
309 TransCustomDataMergeGroup *merge_data = &tcld->merge_group.data[
index];
312 tcld->arena, tcld->merge_group.customdatalayer_map_len *
sizeof(
void *)));
313 for (j = 0; j < tcld->merge_group.customdatalayer_map_len; j++) {
314 const int layer_nr = tcld->merge_group.customdatalayer_map[j];
316 bm,
v, layer_nr, loop_weights, tcld->arena);
320 merge_data->cd_loop_groups =
nullptr;
323 tcld->merge_group.origverts->add(
v, td);
332 auto *origfaces = MEM_new<Map<BMFace *, BMFace *>>(__func__);
358 int layer_math_map_len = 0;
361 customdatalayer_map[layer_math_map_len++] = i;
367 tcld->
merge_group.customdatalayer_map = customdatalayer_map;
368 tcld->
merge_group.customdatalayer_map_len = layer_math_map_len;
369 tcld->
merge_group.origverts = MEM_new<Map<BMVert *, TransDataBasic *>>(__func__);
376 const bool use_merge_group)
410 for (
int j = tc->
data_len; j--; tob++, i++) {
428 if (!customdatacorrect) {
460 bool use_merge_group =
false;
466 use_merge_group =
true;
493 if (tc->custom.type.data !=
nullptr) {
527 const float *co_orig_3d = td->
iloc;
533 const bool do_loop_weight = is_moved && tcld->
merge_group.customdatalayer_map_len;
534 const float *v_proj_axis =
v->
no;
538 if (do_loop_weight) {
546 loop_weights = do_loop_weight ? loop_weights_buf.
data() :
nullptr;
547 for (j = 0; j < l_num; j++) {
553#ifdef USE_FACE_SUBSTITUTE
566 if (do_loop_weight) {
567 const float eps = 1.0e-8f;
582 ((l_prev = l_prev->
prev) !=
l->
next)) [[unlikely]]
589 ((l_next = l_next->
next) !=
l->
prev)) [[unlikely]]
595 if (co_prev_ok && co_next_ok) {
599 loop_weights[j] = (dist >= 0.0f) ? 1.0f : ((dist <= -
eps) ? 0.0f : (1.0f + (dist /
eps)));
600 if (!isfinite(loop_weights[j])) [[unlikely]] {
601 loop_weights[j] = 0.0f;
605 loop_weights[j] = 0.0f;
612 if (tcld->
merge_group.customdatalayer_map_len && cd_loop_groups) {
613 if (do_loop_weight) {
614 for (j = 0; j < tcld->
merge_group.customdatalayer_map_len; j++) {
616 bm, cd_loop_groups[j], tcld->
merge_group.customdatalayer_map[j], loop_weights);
620 for (j = 0; j < tcld->
merge_group.customdatalayer_map_len; j++) {
622 bm, cd_loop_groups[j], tcld->
merge_group.customdatalayer_map[j]);
633 const bool update_loop_mdisps = is_moved && do_loop_mdisps && (tcld->
cd_loop_mdisp_offset != -1);
634 if (update_loop_mdisps) {
644 float f_copy_center[3];
655 faces_center[j_other],
667 if (tcld ==
nullptr) {
674 for (
int i = tc->
data_len; i--; tob++) {
678 if (use_merge_group) {
686 tcld,
static_cast<TransDataBasic *
>(td_mirror), merge_data, is_final);
688 if (use_merge_group) {
714 for (
const auto &item : tcld->
origfaces->items()) {
716 BMFace *f_copy = item.value;
719 BMLoop *l_iter, *l_first, *l_copy;
725 l_copy = l_copy->
next;
726 }
while ((l_iter = l_iter->
next) != l_first);
739 const bool calc_single_islands,
740 const bool calc_island_center,
741 const bool calc_island_axismtx,
751 int *groups_array =
nullptr;
752 int (*group_index)[2] =
nullptr;
755 if (has_only_single_islands && !calc_single_islands) {
765 if (!has_only_single_islands) {
784 if (calc_island_center) {
788 if (calc_island_axismtx) {
795 ele_array = (htype ==
BM_FACE) ?
reinterpret_cast<void **
>(
bm->
ftable) :
796 reinterpret_cast<void **
>(
bm->
etable);
801 for (i = 0; i <
data.island_tot; i++) {
804 const int fg_sta = group_index[i][0];
805 const int fg_len = group_index[i][1];
806 float co[3], no[3], tangent[3];
819 for (j = 0; j < fg_len; j++) {
820 ese.
ele =
static_cast<BMElem *
>(ele_array[groups_array[fg_sta + j]]);
829 float tmp_no[3], tmp_tangent[3];
860 MEM_delete(groups_array);
861 MEM_delete(group_index);
866 if (calc_single_islands) {
869 int group_tot_single = 0;
873 group_tot_single += 1;
877 if (group_tot_single != 0) {
878 if (calc_island_center) {
880 data.center,
sizeof(*
data.center) * (
data.island_tot + group_tot_single)));
882 if (calc_island_axismtx) {
884 data.axismtx,
sizeof(*
data.axismtx) * (
data.island_tot + group_tot_single)));
889 data.island_vert_map[i] =
data.island_tot;
903 data.island_tot += 1;
909 *r_island_data =
data;
914 if (island_data->
center) {
915 MEM_delete(island_data->
center);
918 MEM_delete(island_data->
axismtx);
937 const float mtx[3][3])
945 if (dists[i0] <= dists[i1]) {
955 if (dists[i0] <= dists[i2]) {
959 float vm0[3], vm1[3], vm2[3];
972 dist0 = dists[i1] +
len_v3(vec);
975 if (dist0 < dists[i0]) {
977 if (
index !=
nullptr) {
990 if (edge->
l ==
nullptr) {
1006 const float mtx[3][3],
1033 if (
index !=
nullptr) {
1039 if (
index !=
nullptr) {
1086 if (dists[i1] > dists[i2]) {
1132 BMVert *v_other = l_other->v;
1158 for (
LinkNode *lnk = queue_next; lnk; lnk = lnk->
next) {
1181#define TRANSFORM_MAXDIST_MIRROR 0.00002f
1185 if (quadrant[0] && ((co[0] * quadrant[0]) < -epsilon)) {
1188 if (quadrant[1] && ((co[1] * quadrant[1]) < -epsilon)) {
1191 if (quadrant[2] && ((co[2] * quadrant[2]) < -epsilon)) {
1199 const bool use_select,
1200 const bool use_topology,
1201 const bool mirror_axis[3],
1212 float select_sum[3] = {0};
1225 for (
int a = 0; a < 3; a++) {
1226 if (mirror_axis[a]) {
1227 quadrant[a] = select_sum[a] >= 0.0f ? 1 : -1;
1234 uint mirror_elem_len = 0;
1235 int *
index[3] = {
nullptr,
nullptr,
nullptr};
1236 bool is_single_mirror_axis = (mirror_axis[0] + mirror_axis[1] + mirror_axis[2]) == 1;
1237 bool test_selected_only = use_select && is_single_mirror_axis;
1238 for (
int a = 0; a < 3; a++) {
1239 if (!mirror_axis[a]) {
1256 int i_mirr =
index[a][i];
1269 if (vert_map[i_mirr].flag != 0) {
1274 if (vert_map[i].flag & flag) {
1286 if (!mirror_elem_len) {
1287 MEM_delete(vert_map);
1290 else if (!is_single_mirror_axis) {
1292 for (
int a = 0; a < 3; a++) {
1293 if (!mirror_axis[a]) {
1298 for (i = 0; i < totvert; i++) {
1299 int i_mirr =
index[a][i];
1303 if (vert_map[i].
index != -1 && !(vert_map[i].flag & flag)) {
1304 if (vert_map[i_mirr].
index == -1) {
1308 vert_map[i_mirr].
flag |= vert_map[i].
flag | flag;
1314 MEM_SAFE_DELETE(
index[0]);
1315 MEM_SAFE_DELETE(
index[1]);
1316 MEM_SAFE_DELETE(
index[2]);
1318 r_mirror_data->
vert_map = vert_map;
1339 float (*quats)[4] =
nullptr;
1355 t->
depsgraph, scene_eval, obedit_eval, em, r_crazyspace_data->
defmats, defcos);
1363 if ((totleft > 0) || (totleft == -1))
1375 r_crazyspace_data->
quats = quats;
1379 const float smtx[3][3],
1380 const float defmat[3][3],
1381 const float quat[4],
1385 if (quat || defmat) {
1386 float mat[3][3], qmat[3][3], imat[3][3];
1416 if (r_crazyspace_data->
quats) {
1417 MEM_delete(r_crazyspace_data->
quats);
1428 const int island_index,
1429 const float iloc[3],
1432 if (island_data->
center && island_index != -1) {
1447 const int island_index)
1470 if ((island_index != -1) && island_data->
axismtx) {
1495 Mesh *
mesh = id_cast<Mesh *>(tc->obedit->data);
1499 float mtx[3][3], smtx[3][3];
1537 if (data_len == 0) {
1553 if (is_island_center) {
1560 const bool calc_island_center = !is_snap_rotate;
1566 em,
bm, calc_single_islands, calc_island_center, calc_island_axismtx, &island_data);
1569 copy_m3_m4(mtx, tc->obedit->object_to_world().ptr());
1576 int *dists_index =
nullptr;
1577 float *dists =
nullptr;
1580 if (is_island_center) {
1587 if (tc->use_mirror_axis_any) {
1590 const bool mirror_axis[3] = {
1591 bool(tc->use_mirror_axis_x), bool(tc->use_mirror_axis_y), bool(tc->use_mirror_axis_z)};
1593 em,
bm, use_select, use_topology, mirror_axis, &mirror_data);
1615 tc->data_len = data_len;
1633 int island_index = -1;
1635 const int connected_index = (dists_index && dists_index[a] != -1) ? dists_index[a] : a;
1647 td_mirror->
extra = eve;
1648 td_mirror->
loc = eve->
co;
1671 tob->
dist = dists[a];
1682 !crazyspace_data.
defmats.is_empty() ? crazyspace_data.
defmats[a].ptr() :
nullptr,
1684 crazyspace_data.
quats[a] :
1688 if (tc->use_mirror_axis_any) {
1711 MEM_delete(dists_index);
1718 const bool looptri_is_dirty = em->
looptris.size() !=
1720 if (looptri_is_dirty) {
1740 if (pupdate->
cache) {
1771 return pupdate->
cache;
1775 pupdate->
cache =
nullptr;
1784 int verts_group_count = 0;
1787 int verts_mask_count = 0;
1794 for (i = 0, td = tc->
data; i < tc->data_len; i++, td++) {
1795 if (td->
factor == 0.0f) {
1803 verts_group[v_index] = -1;
1807 verts_group[v_index] = 1;
1808 if (tc->use_mirror_axis_any) {
1814 verts_mask_count += 1;
1825 if (verts_group[v_mirr_index] == 0 &&
equals_v3v3(td_mirror->
loc, td_mirror->
iloc)) {
1835 if (verts_group[v_mirr_index] == -1) {
1836 verts_group[v_mirr_other_index] = -1;
1843 verts_mask_count += 1;
1851 for (i = 0, td = tc->
data; i < tc->data_len; i++, td++) {
1852 if (td->
factor == 0.0f) {
1858 verts_mask[v_index].set();
1859 verts_mask_count += 1;
1873 verts_mask[v_mirr_other_index].set();
1874 verts_mask_count += 1;
1878 switch (partial_type) {
1884 *
bm, params, verts_mask, verts_mask_count);
1893 *
bm, params, verts_group, verts_group_count) :
1895 *
bm, params, verts_mask, verts_mask_count));
1906 return pupdate->
cache;
1934 const float zero_resize_threshold_all = 1e-6f;
1973 r_partial_state->
for_normals = partial_for_normals;
2039 if (tc->use_mirror_axis_any) {
2042 for (i = 0, td = tc->
data; i < tc->data_len; i++, td++) {
2060 td_mirror->
loc[0] *= -1;
2063 td_mirror->
loc[1] *= -1;
2066 td_mirror->
loc[2] *= -1;
2085 if (!is_canceling) {
2112 if (tc->has_mirror_clipping) {
2144 if (use_automerge) {
2151 if (tc->use_mirror_axis_any) {
2157 for (
int i = tc->data_mirror_len; i--; td_mirror++) {
2200 int td_selected_len = 0;
2206 int sv_array_index = 0;
2209 const int size_prev = r_loc_dst_buffer.
size();
2220 r_loc_dst_buffer.
append(v_other->
co);
2223 if (r_loc_dst_buffer.
size() == size_prev) {
2226 r_loc_dst_buffer.append(td->iloc);
2230 sv.td = &tc->
data[i];
2235 sv.co_link_curr = r_loc_dst_buffer.
size() - size_prev;
2242 int size = sv.co_link_curr;
2243 sv.co_link_orig_3d = r_loc_dst_buffer.
as_span().slice(start, size);
2244 sv.co_link_curr = 0;
2286 if (dist_sq_test < dist_sq_best) {
2288 dist_sq_best = dist_sq_test;
2293 }
while ((l_iter = l_iter->
next) != l_last);
2323 int td_selected_len = 0;
2328 bool found_invalid_edge_selection =
false;
2333 if (numsel == 0 || numsel > 2) {
2335 found_invalid_edge_selection =
true;
2341 if (found_invalid_edge_selection) {
2391 if (
ELEM(-1, td_index_1, td_index_2)) {
2395 int slot_1 = int(td_connected[td_index_1][0] != -1);
2396 int slot_2 = int(td_connected[td_index_2][0] != -1);
2398 td_connected[td_index_1][slot_1] = td_index_2;
2399 td_connected[td_index_2][slot_2] = td_index_1;
2413 int i_prev = td_connected[i][1];
2414 while (!
ELEM(i_prev, -1, i)) {
2415 int tmp = td_connected[i_prev][0] != i_curr ? td_connected[i_prev][0] :
2416 td_connected[i_prev][1];
2430 struct SlideTempDataMesh {
2440 bool vert_is_edge_pair;
2449 int find_best_dir(
const SlideTempDataMesh *curr_side_other,
2453 bool *r_do_isect_curr_dirs)
const
2455 *r_do_isect_curr_dirs =
false;
2457 if (f_curr == curr_side_other->fdata[0].f || v_dst == curr_side_other->fdata[0].v_dst) {
2461 if (f_curr == curr_side_other->fdata[1].f || v_dst == curr_side_other->fdata[1].v_dst) {
2465 if (curr_side_other->fdata[0].f || curr_side_other->fdata[1].f) {
2470 while (l_other->
f != l_edge->
f) {
2471 if (l_other->
f == curr_side_other->fdata[0].f) {
2475 if (l_other->
f == curr_side_other->fdata[1].f) {
2479 l_other = (l_other->
v == this->v ? l_other->
prev : l_other->
next)->radial_next;
2482 if (best_dir != -1) {
2483 *r_do_isect_curr_dirs =
true;
2488 if (
ELEM(
nullptr, this->fdata[0].f, this->fdata[1].f)) {
2489 return int(this->fdata[0].f !=
nullptr);
2497 *r_do_isect_curr_dirs =
true;
2504 if (is_boundary_0 && !is_boundary_1) {
2508 if (is_boundary_1 && !is_boundary_0) {
2515 float3 dir_curr = dst - src;
2520 return int(dot0 < dot1);
2522 } prev = {}, curr = {}, next = {}, next_next = {}, tmp = {};
2524 next.i = td_connected[i_curr][0] != i_prev ? td_connected[i_curr][0] : td_connected[i_curr][1];
2526 next.sv = &sv_array[next.i];
2527 next.v =
static_cast<BMVert *
>(next.sv->td->extra);
2533 curr.sv = &sv_array[curr.i];
2534 curr.v =
static_cast<BMVert *
>(curr.sv->td->extra);
2544 while (curr.i != -1) {
2546 next_next.i = td_connected[next.i][0] != curr.i ? td_connected[next.i][0] :
2547 td_connected[next.i][1];
2548 if (next_next.i != -1) {
2549 next_next.sv = &sv_array[next_next.i];
2550 next_next.v =
static_cast<BMVert *
>(next_next.sv->td->extra);
2564 if (
l->
v == curr.v) {
2567 l_edge_next = l2->
e;
2568 v1_dst = l1->
prev->
v;
2569 v2_dst = l2->
next->
v;
2574 l_edge_next = l2->
prev->
e;
2575 v1_dst = l1->
next->
v;
2576 v2_dst = l2->
prev->
v;
2583 bool isect_curr_dirs =
false;
2586 int best_dir = curr.find_best_dir(&tmp, f_curr, l1, v1_dst, &isect_curr_dirs);
2588 if (curr.fdata[best_dir].f ==
nullptr) {
2589 curr.fdata[best_dir].f = f_curr;
2590 if (curr.vert_is_edge_pair) {
2594 curr.fdata[best_dir].v_dst = v1_dst;
2595 curr.fdata[best_dir].dst = v1_dst->
co;
2600 next.fdata[best_dir].f = f_curr;
2601 if (l_edge_next == next.e || next.vert_is_edge_pair) {
2603 next.fdata[best_dir].v_dst =
nullptr;
2608 next.fdata[best_dir].v_dst = v2_dst;
2609 next.fdata[best_dir].dst = v2_dst->
co;
2612 if (isect_curr_dirs) {
2614 const float *curr_orig = curr.sv->v_co_orig();
2615 const float3 &dst0 = prev.fdata[best_dir].dst;
2616 const float3 &dst1 = curr.fdata[best_dir].dst;
2617 const float3 &dst2 = dst;
2618 const float3 &dst3 = next.fdata[best_dir].dst;
2689 dst0, dst1, dst2, dst3, isect_pair[0], isect_pair[1], isect_eps);
2691 if (isect_line_line != 0) {
2698 if (len_n < isect_eps) [[unlikely]] {
2699 isect_line_line = 0;
2708 if ((len1 < isect_eps) || (len2 < isect_eps)) [[unlikely]] {
2709 isect_line_line = 0;
2712 for (
int isect_pass = 0; isect_pass < isect_line_line; isect_pass++) {
2713 const float3 isect_co = isect_pair[isect_pass] -
float3(curr_orig);
2714 if ((
math::dot(isect_co, plane_no_1) <= 0.0f) ||
2715 (
math::dot(isect_co, plane_no_2) <= 0.0f))
2718 isect_line_line = 0;
2726 if (isect_line_line != 0) {
2727 curr.fdata[best_dir].dst =
math::midpoint(isect_pair[0], isect_pair[1]);
2737 float3 iloc = curr.sv->td->iloc;
2738 if (curr.fdata[0].f) {
2739 curr.sv->dir_side[0] = curr.fdata[0].dst - iloc;
2741 if (curr.fdata[1].f) {
2742 curr.sv->dir_side[1] = curr.fdata[1].dst - iloc;
2744 curr.sv->edge_len =
math::distance(curr.sv->dir_side[0], curr.sv->dir_side[1]);
2745 curr.sv->loop_nr = loop_nr;
2747 if (i_prev != -1 && prev.i == i_prev) {
2761 *r_group_len = loop_nr;
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_SIZE(var)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
#define BLI_LINKSTACK_SWAP(var_a, var_b)
#define PSEUDOINVERSE_EPSILON
#define mul_m3_series(...)
#define BLI_MEMARENA_STD_BUFSIZE
Read Blender memory allocation and freeing.
#define BLI_assert_unreachable()
#define POINTER_OFFSET(v, ofs)
#define BM_FACE_FIRST_LOOP(p)
#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_iter_init(iter, bm, itype, data)
#define BM_ITER_ELEM_INDEX(ele, iter, data, itype, indexvar)
#define MEM_realloc_uninitialized(vmemh, len)
IndexRange index_range() const
void append(const T &value)
void reserve(const int64_t min_capacity)
Span< T > as_span() const
void resize(const int64_t new_size_in_bits, const bool value=false)
bool shape_key_report_if_locked(const Object *obedit, ReportList *reports)
T distance(const T &a, const T &b)
QuaternionBase< T > normalize_and_get_length(const QuaternionBase< T > &q, T &out_length)
T dot(const QuaternionBase< T > &a, const QuaternionBase< T > &b)
T midpoint(const T &a, const T &b)
AxisSigned cross(const AxisSigned a, const AxisSigned b)
MatBase< T, NumCol, NumRow > normalize(const MatBase< T, NumCol, NumRow > &a)
void BM_face_calc_center_median(const BMFace *f, float r_cent[3])
void BM_loop_calc_face_direction(const BMLoop *l, float r_dir[3])
BM_loop_calc_face_direction.
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
BMFace * BM_face_copy(BMesh *bm_dst, const BMCustomDataCopyMap &cd_face_map, const BMCustomDataCopyMap &cd_loop_map, BMFace *f, const bool copy_verts, const bool copy_edges)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void mul_m3_v3(const float M[3][3], float r[3])
@ UVCALC_TRANSFORM_CORRECT_KEEP_CONNECTED
@ UVCALC_TRANSFORM_CORRECT_SLIDE
@ UVCALC_TRANSFORM_CORRECT
bool EDBM_automerge(Object *obedit, bool update, char hflag, float dist, bool use_centroid)
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
int isect_line_line_epsilon_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3], float r_i1[3], float r_i2[3], float epsilon)
int BKE_crazyspace_get_first_deform_matrices_editbmesh(Depsgraph *depsgraph, Scene *, Object *, BMEditMesh *em, Array< float3x3, 0 > &deformmats, Array< float3, 0 > &deformcos)
void BM_vert_loop_groups_data_layer_merge(BMesh *bm, LinkNode *groups, const int layer_n)
MemArena * BLI_memarena_new(size_t bufsize, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL ATTR_NONNULL(2) ATTR_MALLOC
void BM_mesh_free(BMesh *bm)
BMesh Free Mesh.
void BKE_editmesh_looptris_calc(BMEditMesh *em, BMesh *bm)
BMesh * BKE_editmesh_bmesh_get_for_write(Mesh *mesh)
void BKE_editmesh_looptris_calc_with_partial_ex(BMEditMesh *em, BMesh *bm, BMPartialUpdate *bmpinfo, const BMeshCalcTessellation_Params *params)
MINLINE void copy_v3_v3(float r[3], const float a[3])
int BM_iter_elem_count_flag(const char itype, void *data, const char hflag, const bool value)
Elem Iter Flag Count.
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void BM_editselection_center(BMEditSelection *ese, float r_center[3])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool BKE_modifiers_is_correctable_deformed(const Scene *scene, Object *ob)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
void BM_mesh_elem_table_ensure(BMesh *bm, const char htype)
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void BM_vert_loop_groups_data_layer_merge_weights(BMesh *bm, LinkNode *groups, const int layer_n, const float *loop_weights)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
bool invert_m3_m3(float inverse[3][3], const float mat[3][3])
BMCustomDataCopyMap CustomData_bmesh_copy_map_calc(const CustomData &src, const CustomData &dst, eCustomDataMask mask_exclude=0)
float angle_v3v3v3(const float a[3], const float b[3], const float c[3]) ATTR_WARN_UNUSED_RESULT
void BKE_crazyspace_set_quats_editmesh(BMesh *bm, Span< float3 > origcos, Span< float3 > mappedcos, float(*quats)[4], bool use_select)
void ED_mesh_mirror_spatial_table_end(Object *ob)
@ V3D_AROUND_LOCAL_ORIGINS
BMPartialUpdate * BM_mesh_partial_create_from_verts_group_multi(BMesh &bm, const BMPartialUpdate_Params ¶ms, const Span< int > verts_group, const int verts_group_count)
void BM_mesh_elem_hflag_disable_all(BMesh *bm, const char htype, const char hflag, const bool respecthide)
void project_plane_normalized_v3_v3v3(float out[3], const float p[3], const float v_plane[3])
ATTR_WARN_UNUSED_RESULT const BMVert * v
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BM_mesh_calc_edge_groups(BMesh *bm, int *r_groups_array, int(**r_group_index)[2], BMVertFilterFunc filter_fn, void *user_data, const char hflag_test)
bool BM_vert_is_boundary(const BMVert *v)
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
void quat_to_mat3(float m[3][3], const float q[4])
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, BMesh *bm, int axis, bool use_self, bool use_select, bool respecthide, bool use_topology, float maxdist, int *r_index)
VecBase< int32_t, 2 > int2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
bool BM_vert_calc_normal_ex(const BMVert *v, const char hflag, float r_no[3])
float BM_vert_calc_shell_factor_ex(const BMVert *v, const float no[3], const char hflag)
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void BKE_editmesh_looptris_and_normals_calc(BMEditMesh *em, BMesh *bm)
const BMAllocTemplate bm_mesh_allocsize_default
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BKE_modifiers_get_cage_index(const Scene *scene, Object *ob, int *r_lastPossibleCageIndex, bool is_virtual)
void BM_editselection_plane(BMEditSelection *ese, float r_plane[3])
BMLoop * BM_loop_find_next_nodouble(BMLoop *l, BMLoop *l_stop, const float eps_sq)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE int poly_to_tri_count(int poly_count, int corner_count)
MINLINE void zero_v3(float r[3])
BLI_INLINE BMVert * BM_vert_at_index(BMesh *bm, const int index)
bool isect_line_plane_v3(float r_isect_co[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3]) ATTR_WARN_UNUSED_RESULT
bool EDBM_automerge_and_split(Object *obedit, bool split_edges, bool split_faces, bool update, char hflag, float dist)
BMEditMesh * BKE_editmesh_from_object(Object *ob)
Return the BMEditMesh for a given object.
bool invert_m3(float mat[3][3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
void * BLI_memarena_alloc(MemArena *ma, size_t size) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_ALLOC_SIZE(2)
BMEdge * BM_edge_exists(BMVert *v_a, BMVert *v_b)
MINLINE float normalize_v3(float n[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
void EDBM_selectmode_flush_ex(BMesh *bm, short selectmode)
Main * CTX_data_main(const bContext *C)
void unit_m3(float m[3][3])
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void BM_mesh_copy_init_customdata_all_layers(BMesh *bm_dst, BMesh *bm_src, const char htype, const BMAllocTemplate *allocsize)
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)
@ BMO_OPTYPE_FLAG_UNTAN_MULTIRES
void bmesh_edit_begin(BMesh *, BMOpTypeFlag)
BMesh Begin Edit.
float geodesic_distance_propagate_across_triangle(const float v0[3], const float v1[3], const float v2[3], float dist1, float dist2)
bool BM_vert_is_edge_pair(const BMVert *v)
BMLoop * BM_loop_find_prev_nodouble(BMLoop *l, BMLoop *l_stop, const float eps_sq)
void pseudoinverse_m3_m3(float inverse[3][3], const float mat[3][3], float epsilon)
void BM_mesh_partial_destroy(BMPartialUpdate *bmpinfo)
Array< float3 > BKE_crazyspace_get_mapped_editverts(Depsgraph *depsgraph, Object *obedit)
int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const bool value)
Mesh Iter Flag Count.
void BM_face_interp_multires_ex(BMesh *bm, BMFace *f_dst, const BMFace *f_src, const float f_dst_center[3], const float f_src_center[3], const int cd_loop_mdisp_offset)
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void BM_elem_attrs_copy(BMesh *bm, const BMCustomDataCopyMap &map, const BMVert *src, BMVert *dst)
bool CustomData_has_math(const CustomData *data)
VecBase< float, 3 > float3
BMPartialUpdate * BM_mesh_partial_create_from_verts(BMesh &bm, const BMPartialUpdate_Params ¶ms, const BitSpan verts_mask, const int verts_mask_count)
void bmesh_edit_end(BMesh *bm, BMOpTypeFlag type_flag)
BMesh End Edit.
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
BMPartialUpdate * BM_mesh_partial_create_from_verts_group_single(BMesh &bm, const BMPartialUpdate_Params ¶ms, const BitSpan verts_mask, const int verts_mask_count)
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
void BM_editselection_normal(BMEditSelection *ese, float r_normal[3])
float dist_signed_squared_to_corner_v3v3v3(const float p[3], const float v1[3], const float v2[3], const float v3[3], const float axis_ref[3])
MINLINE bool is_zero_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
void BM_mesh_normals_update_with_partial_ex(BMesh *, const BMPartialUpdate *bmpinfo, const BMeshNormalsUpdate_Params *params)
bool CustomData_layer_has_math(const CustomData *data, int layer_n)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void BM_loop_interp_from_face(BMesh *bm, BMLoop *l_dst, const BMFace *f_src, const bool do_vertex, const bool do_multires)
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3])
Normal to x,y matrix.
void BLI_memarena_free(MemArena *ma) ATTR_NONNULL(1)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
LinkNode * BM_vert_loop_groups_data_layer_create(BMesh *bm, BMVert *v, const int layer_n, const float *loop_weights, MemArena *arena)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
Array< std::array< BMLoop *, 3 > > looptris
struct BMLoop * radial_next
struct ToolSettings * toolsettings