145 const int size = face_verts.
size();
150 verts[i] = vtable[face_verts[i]];
151 edges[i] = etable[face_edges[i]];
174 std::array<int, CD_NUMTYPES> per_type_index;
175 per_type_index.
fill(0);
179 const int mesh_layer_index =
180 bm_layer.
name[0] ==
'\0' ?
186 info.bmesh_offset = bm_layer.
offset;
187 info.mesh_data = (mesh_layer_index == -1) ?
nullptr : mesh_data.
layers[mesh_layer_index].
data;
191 per_type_index[type]++;
198 const int mesh_index,
203 if (info.mesh_data) {
224 float(*keyco)[3] =
nullptr;
239 for (
const int layer_index :
248 temporary_layers_to_delete.
append(std::string(name));
255 temporary_layers_to_delete.
append(std::string(name));
262 temporary_layers_to_delete.
append(std::string(name));
267 for (
const std::string &name : temporary_layers_to_delete) {
277 if (mesh->verts_num == 0) {
294 if (
params->calc_vert_normal) {
295 vert_normals = mesh->vert_normals();
317 int tot_shape_keys = 0;
342 if (is_new ==
false) {
346 shape_key_table, tot_shape_keys) :
349 if ((
params->active_shapekey != 0) && tot_shape_keys > 0) {
357 if (tot_shape_keys ||
params->add_key_index) {
362 if (tot_shape_keys) {
366 if (!mesh->key->uidgen) {
368 "%s had to generate shape key uid's in a situation we shouldn't need to! "
369 "(bmesh internal error)\n",
372 mesh->key->uidgen = 1;
374 block->uid = mesh->key->uidgen++;
379 if (actkey && actkey->
totelem == mesh->verts_num) {
380 keyco =
params->use_shapekey ?
static_cast<float(*)[3]
>(actkey->
data) :
nullptr;
388 for (i = 0, block =
static_cast<KeyBlock *
>(mesh->key->block.first); i < tot_shape_keys;
389 block = block->
next, i++)
396 shape_key_table[i] =
static_cast<const float(*)[3]
>(block->
data);
415 const int cd_shape_keyindex_offset = is_new && (tot_shape_keys ||
params->add_key_index) ?
420 const VArraySpan select_vert = *attributes.lookup<
bool>(
".select_vert", AttrDomain::Point);
421 const VArraySpan select_edge = *attributes.lookup<
bool>(
".select_edge", AttrDomain::Edge);
422 const VArraySpan select_poly = *attributes.lookup<
bool>(
".select_poly", AttrDomain::Face);
423 const VArraySpan hide_vert = *attributes.lookup<
bool>(
".hide_vert", AttrDomain::Point);
424 const VArraySpan hide_edge = *attributes.lookup<
bool>(
".hide_edge", AttrDomain::Edge);
425 const VArraySpan hide_poly = *attributes.lookup<
bool>(
".hide_poly", AttrDomain::Face);
426 const VArraySpan material_indices = *attributes.lookup<
int>(
"material_index", AttrDomain::Face);
427 const VArraySpan sharp_faces = *attributes.lookup<
bool>(
"sharp_face", AttrDomain::Face);
428 const VArraySpan sharp_edges = *attributes.lookup<
bool>(
"sharp_edge", AttrDomain::Edge);
429 const VArraySpan uv_seams = *attributes.lookup<
bool>(
".uv_seam", AttrDomain::Edge);
433 for (
const int i : positions.index_range()) {
438 if (!hide_vert.is_empty() && hide_vert[i]) {
441 if (!select_vert.
is_empty() && select_vert[i]) {
452 if (cd_shape_keyindex_offset != -1) {
457 if (tot_shape_keys) {
459 for (
int j = 0; j < tot_shape_keys; j++, co_dst++) {
470 for (
const int i : edges.index_range()) {
476 if (!uv_seams.is_empty() && uv_seams[i]) {
479 if (!hide_edge.is_empty() && hide_edge[i]) {
482 if (!select_edge.is_empty() && select_edge[i]) {
485 if (!(!sharp_edges.is_empty() && sharp_edges[i])) {
496 const Span<int> corner_verts = mesh->corner_verts();
497 const Span<int> corner_edges = mesh->corner_edges();
502 if (mesh->mselect && mesh->totselect != 0) {
507 for (
const int i : faces.index_range()) {
510 *
bm, corner_verts.
slice(face), corner_edges.
slice(face), vtable, etable);
517 "%s: Warning! Bad face in mesh"
518 " \"%s\" at index %d!, skipping\n",
529 if (!(!sharp_faces.is_empty() && sharp_faces[i])) {
532 if (!hide_poly.is_empty() && hide_poly[i]) {
535 if (!select_poly.is_empty() && select_poly[i]) {
539 f->
mat_nr = material_indices.is_empty() ? 0 : material_indices[i];
540 if (i == mesh->act_face) {
544 int j = face.start();
553 }
while ((l_iter = l_iter->
next) != l_first);
557 if (
params->calc_face_normal) {
571 if (mesh->mselect && mesh->totselect != 0) {
572 for (
const int i :
IndexRange(mesh->totselect)) {
573 const MSelect &msel = mesh->mselect[i];
590 if (*ele_p !=
nullptr) {
607 BMVert **vertMap =
nullptr;
615 vertMap =
static_cast<BMVert **
>(
MEM_callocN(
sizeof(*vertMap) * old_verts_num,
"vertMap"));
616 if (cd_shape_keyindex_offset != -1) {
623 (vertMap[keyi] ==
nullptr))
631 if (i < old_verts_num) {
759 const bool active_shapekey_to_mvert)
764 bool actkey_has_layer =
false;
781 if (currkey == actkey) {
782 actkey_has_layer =
true;
794 float(*ofs)[3] =
nullptr;
795 std::optional<Array<bool>> dependent;
800 (actkey_has_layer ==
true) &&
802 (cd_shape_keyindex_offset != -1) &&
844 bool update_vertex_coords_from_refkey =
false;
845 int cd_shape_offset_refkey = -1;
846 if (active_shapekey_to_mvert ==
false) {
847 if ((actkey != key->
refkey) && (cd_shape_keyindex_offset != -1)) {
849 if (refkey_uuid != -1) {
851 if (cd_shape_offset_refkey != -1) {
852 update_vertex_coords_from_refkey =
true;
861 float(*currkey_data)[3];
864 const int cd_shape_offset = (currkey_uuid == -1) ?
869 if (cd_shape_offset != -1) {
870 const bool apply_offset = (ofs !=
nullptr) && (currkey != actkey) && (*dependent)[currkey_i];
872 if (currkey->data && (currkey->totelem ==
bm->
totvert)) {
879 currkey_data = (
float(*)[3])currkey->data;
885 if (currkey == actkey) {
888 if (update_vertex_coords_from_refkey) {
915 if (currkey->data && (cd_shape_keyindex_offset != -1)) {
917 "Found shape-key but no CD_SHAPEKEY layers to read from, "
918 "using existing shake-key data where possible");
922 "Found shape-key but no CD_SHAPEKEY layers to read from, "
923 "using basis shape-key data");
926 currkey_data =
static_cast<float(*)[3]
>(
932 if ((currkey->data !=
nullptr) && (cd_shape_keyindex_offset != -1) &&
934 (keyi < currkey->totelem))
941 const float(*oldkey)[3] =
static_cast<const float(*)[3]
>(currkey->data);
954 currkey->data = currkey_data;
983 const int old_totvert)
985 BMVert **vertMap =
nullptr;
991 if (vertMap ==
nullptr) {
995 if (ob->par1 < old_totvert) {
996 eve = vertMap[ob->par1];
1001 if (ob->par2 < old_totvert) {
1002 eve = vertMap[ob->par2];
1007 if (ob->par3 < old_totvert) {
1008 eve = vertMap[ob->par3];
1014 if (ob->data == &mesh) {
1019 if (vertMap ==
nullptr) {
1024 if (hmd->
indexar[i] < old_totvert) {
1025 eve = vertMap[hmd->
indexar[i]];
1064 std::array<int, CD_NUMTYPES> per_type_index;
1065 per_type_index.
fill(0);
1069 const int bm_layer_index =
1070 mesh_layer.
name[0] ==
'\0' ?
1076 if (bm_layer_index == -1) {
1086 info.bmesh_offset = bm_layer.
offset;
1087 info.mesh_data = mesh_layer.
data;
1091 per_type_index[type]++;
1100 bool &need_select_vert,
1101 bool &need_hide_vert)
1118 bool &need_select_edge,
1119 bool &need_hide_edge,
1120 bool &need_sharp_edge,
1121 bool &need_uv_seams)
1130 hflag |= edge->head.hflag;
1147 bool &need_select_poly,
1148 bool &need_hide_poly,
1149 bool &need_sharp_face,
1150 bool &need_material_index,
1160 auto add_bool_layer = [&](
Vector<int> &layers,
const char *name) {
1162 if (layer_index != -1) {
1163 layers.append(layer_index);
1173 for (
const int i : vert_sel_layers.
index_range()) {
1174 vert_sel_offsets[i] = ldata.
layers[vert_sel_layers[i]].
offset;
1176 for (
const int i : edge_sel_layers.
index_range()) {
1177 edge_sel_offsets[i] = ldata.
layers[edge_sel_layers[i]].
offset;
1193 face_table[face_i] = face;
1194 hflag |= face->head.hflag;
1196 need_material_index |= face->mat_nr != 0;
1199 for ([[maybe_unused]]
const int i :
IndexRange(face->len)) {
1201 loop_table[loop_i] = loop;
1202 for (
const int i : vert_sel_offsets.
index_range()) {
1204 need_vert_sel[i] =
true;
1207 for (
const int i : edge_sel_offsets.
index_range()) {
1209 need_edge_sel[i] =
true;
1224 for (
const int i : vert_sel_layers.
index_range()) {
1225 if (!need_vert_sel[i]) {
1226 loop_layers_not_to_copy.
append(vert_sel_layers[i]);
1229 for (
const int i : edge_sel_layers.
index_range()) {
1230 if (!need_edge_sel[i]) {
1231 loop_layers_not_to_copy.
append(edge_sel_layers[i]);
1236 loop_layers_not_to_copy.
append(pin_layers[i]);
1242 const int mesh_index,
1264 std::atomic<bool> any_loose_vert =
false;
1266 bool any_loose_vert_local = false;
1267 for (const int vert_i : range) {
1268 const BMVert &src_vert = *bm_verts[vert_i];
1269 copy_v3_v3(dst_vert_positions[vert_i], src_vert.co);
1270 bmesh_block_copy_to_mesh_attributes(info, vert_i, src_vert.head.data);
1271 any_loose_vert_local = any_loose_vert_local || src_vert.e == nullptr;
1273 if (any_loose_vert_local) {
1274 any_loose_vert.store(
true, std::memory_order_relaxed);
1277 for (const int vert_i : range) {
1278 select_vert[vert_i] = BM_elem_flag_test(bm_verts[vert_i], BM_ELEM_SELECT);
1281 if (!hide_vert.is_empty()) {
1282 for (const int vert_i : range) {
1283 hide_vert[vert_i] = BM_elem_flag_test(bm_verts[vert_i], BM_ELEM_HIDDEN);
1288 if (!any_loose_vert) {
1289 mesh.tag_loose_verts_none();
1307 std::atomic<bool> any_loose_edge =
false;
1309 bool any_loose_edge_local = false;
1310 for (const int edge_i : range) {
1311 const BMEdge &src_edge = *bm_edges[edge_i];
1312 dst_edges[edge_i] = int2(BM_elem_index_get(src_edge.v1), BM_elem_index_get(src_edge.v2));
1313 bmesh_block_copy_to_mesh_attributes(info, edge_i, src_edge.head.data);
1314 any_loose_edge_local |= BM_edge_is_wire(&src_edge);
1316 if (any_loose_edge_local) {
1317 any_loose_edge.store(
true, std::memory_order_relaxed);
1320 for (const int edge_i : range) {
1321 select_edge[edge_i] = BM_elem_flag_test(bm_edges[edge_i], BM_ELEM_SELECT);
1324 if (!hide_edge.is_empty()) {
1325 for (const int edge_i : range) {
1326 hide_edge[edge_i] = BM_elem_flag_test(bm_edges[edge_i], BM_ELEM_HIDDEN);
1329 if (!sharp_edge.is_empty()) {
1330 for (const int edge_i : range) {
1331 sharp_edge[edge_i] = !BM_elem_flag_test(bm_edges[edge_i], BM_ELEM_SMOOTH);
1334 if (!uv_seams.is_empty()) {
1335 for (const int edge_i : range) {
1336 uv_seams[edge_i] = BM_elem_flag_test(bm_edges[edge_i], BM_ELEM_SEAM);
1341 if (!any_loose_edge) {
1342 mesh.tag_loose_edges_none();
1358 for (const int face_i : range) {
1359 const BMFace &src_face = *bm_faces[face_i];
1360 dst_face_offsets[face_i] = BM_elem_index_get(BM_FACE_FIRST_LOOP(&src_face));
1361 bmesh_block_copy_to_mesh_attributes(info, face_i, src_face.head.data);
1364 for (const int face_i : range) {
1365 select_poly[face_i] = BM_elem_flag_test(bm_faces[face_i], BM_ELEM_SELECT);
1368 if (!hide_poly.is_empty()) {
1369 for (const int face_i : range) {
1370 hide_poly[face_i] = BM_elem_flag_test(bm_faces[face_i], BM_ELEM_HIDDEN);
1373 if (!material_indices.is_empty()) {
1374 for (const int face_i : range) {
1375 material_indices[face_i] = bm_faces[face_i]->mat_nr;
1378 if (!sharp_faces.is_empty()) {
1379 for (const int face_i : range) {
1380 sharp_faces[face_i] = !BM_elem_flag_test(bm_faces[face_i], BM_ELEM_SMOOTH);
1398 for (const int loop_i : range) {
1399 const BMLoop &src_loop = *bm_loops[loop_i];
1400 dst_corner_verts[loop_i] = BM_elem_index_get(src_loop.v);
1401 dst_corner_edges[loop_i] = BM_elem_index_get(src_loop.e);
1402 bmesh_block_copy_to_mesh_attributes(info, loop_i, src_loop.head.data);
1412 const int old_verts_num = mesh->verts_num;
1418 mesh->totface_legacy = 0;
1421 mesh->act_face = -1;
1423 bool need_select_vert =
false;
1424 bool need_select_edge =
false;
1425 bool need_select_poly =
false;
1426 bool need_hide_vert =
false;
1427 bool need_hide_edge =
false;
1428 bool need_hide_poly =
false;
1429 bool need_material_index =
false;
1430 bool need_sharp_edge =
false;
1431 bool need_sharp_face =
false;
1432 bool need_uv_seams =
false;
1438 threading::parallel_invoke(
1439 (mesh->faces_num + mesh->edges_num) > 1024,
1441 vert_table.reinitialize(bm->totvert);
1442 bm_vert_table_build(*bm, vert_table, need_select_vert, need_hide_vert);
1445 edge_table.reinitialize(bm->totedge);
1446 bm_edge_table_build(
1447 *bm, edge_table, need_select_edge, need_hide_edge, need_sharp_edge, need_uv_seams);
1450 face_table.reinitialize(bm->totface);
1451 loop_table.reinitialize(bm->totloop);
1452 bm_face_loop_table_build(*bm,
1458 need_material_index,
1459 loop_layers_not_to_copy);
1460 for (const int i : loop_layers_not_to_copy) {
1461 bm->ldata.layers[i].flag |= CD_FLAG_NOCOPY;
1492 if (need_select_vert) {
1495 if (need_hide_vert) {
1498 if (need_select_edge) {
1501 if (need_sharp_edge) {
1504 if (need_uv_seams) {
1507 if (need_hide_edge) {
1510 if (need_select_poly) {
1513 if (need_hide_poly) {
1516 if (need_sharp_face) {
1519 if (need_material_index) {
1525 threading::parallel_invoke(
1526 (mesh->faces_num + mesh->edges_num) > 1024,
1528 bm_to_mesh_verts(*bm, vert_table, *mesh, select_vert.span, hide_vert.span);
1531 bm, mesh->key, mesh->vert_positions_for_write(), params->active_shapekey_to_mvert);
1550 material_index.
span);
1559 for (
const int i : loop_layers_not_to_copy) {
1565 if (
params->calc_object_remap && (old_verts_num > 0)) {
1573 if (mesh->totselect != 0) {
1574 mesh->mselect =
static_cast<MSelect *
>(
1579 if (selected->htype ==
BM_VERT) {
1582 else if (selected->htype ==
BM_EDGE) {
1583 mesh->mselect[i].type =
ME_ESEL;
1585 else if (selected->htype ==
BM_FACE) {
1586 mesh->mselect[i].type =
ME_FSEL;
1595 if (
params->update_shapekey_indices) {
1600 if (cd_shape_keyindex_offset != -1) {
1626 const bool add_mesh_attributes)
1639 mesh.totface_legacy = 0;
1643 mesh.runtime->deformed_only =
true;
1645 const bool use_threading = (mesh.faces_num + mesh.edges_num) > 1024;
1650 bool need_select_vert =
false;
1651 bool need_select_edge =
false;
1652 bool need_select_poly =
false;
1653 bool need_hide_vert =
false;
1654 bool need_hide_edge =
false;
1655 bool need_hide_poly =
false;
1656 bool need_material_index =
false;
1657 bool need_sharp_edge =
false;
1658 bool need_sharp_face =
false;
1659 bool need_uv_seams =
false;
1666 threading::parallel_invoke(
1670 bm_vert_table_build(
bm, vert_table, need_select_vert, need_hide_vert);
1674 bm_edge_table_build(
1675 bm, edge_table, need_select_edge, need_hide_edge, need_sharp_edge, need_uv_seams);
1680 bm_face_loop_table_build(
bm,
1686 need_material_index,
1687 loop_layers_not_to_copy);
1688 for (
const int i : loop_layers_not_to_copy) {
1715 if (add_mesh_attributes) {
1717 if (need_select_vert) {
1721 if (need_hide_vert) {
1724 if (need_select_edge) {
1728 if (need_sharp_edge) {
1731 if (need_uv_seams) {
1734 if (need_hide_edge) {
1737 if (need_select_poly) {
1741 if (need_hide_poly) {
1744 if (need_sharp_face) {
1747 if (need_material_index) {
1754 threading::parallel_invoke(
1756 [&]() { bm_to_mesh_verts(
bm, vert_table, mesh, select_vert.
span, hide_vert.
span); },
1758 bm_to_mesh_edges(
bm,
1767 bm_to_mesh_faces(
bm,
1773 material_index.
span);
1779 bm_to_mesh_loops(
bm, loop_table, mesh);
1780 for (
const int i : loop_layers_not_to_copy) {
1785 if (add_mesh_attributes) {
1804 if (cd_mask_extra !=
nullptr) {
1807 mask.vmask &= ~CD_MASK_SHAPEKEY;
const char * BKE_uv_map_pin_name_get(const char *uv_map_name, char *buffer)
const char * BKE_uv_map_vert_select_name_get(const char *uv_map_name, char *buffer)
const char * BKE_uv_map_edge_select_name_get(const char *uv_map_name, char *buffer)
CustomData interface, see also DNA_customdata_types.h.
void CustomData_data_set_default_value(eCustomDataType type, void *elem)
int CustomData_get_offset(const CustomData *data, eCustomDataType type)
int CustomData_get_layer_index_n(const CustomData *data, eCustomDataType type, int n)
bool CustomData_bmesh_merge_layout(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, BMesh *bm, char htype)
bool CustomData_free_layer_named(CustomData *data, blender::StringRef name, const int totelem)
int CustomData_get_n_offset(const CustomData *data, eCustomDataType type, int n)
void * CustomData_add_layer_named(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem, blender::StringRef name)
void CustomData_MeshMasks_update(CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
void CustomData_bmesh_init_pool(CustomData *data, int totelem, char htype)
int CustomData_get_named_layer_index(const CustomData *data, eCustomDataType type, blender::StringRef name)
bool CustomData_has_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
const char * CustomData_get_layer_name(const CustomData *data, eCustomDataType type, int n)
void CustomData_data_copy_value(eCustomDataType type, const void *source, void *dest)
const CustomData_MeshMasks CD_MASK_BMESH
void CustomData_init_layout_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
CustomData CustomData_shallow_copy_remove_non_bmesh_attributes(const CustomData *src, eCustomDataMask mask)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
size_t CustomData_get_elem_size(const CustomDataLayer *layer)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
const CustomData_MeshMasks CD_MASK_DERIVEDMESH
bool CustomData_merge_layout(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
int CustomData_number_of_layers(const CustomData *data, eCustomDataType type)
void CustomData_bmesh_alloc_block(CustomData *data, void **block)
const CustomData_MeshMasks CD_MASK_MESH
KeyBlock * BKE_keyblock_add(Key *key, const char *name)
std::optional< blender::Array< bool > > BKE_keyblock_get_dependent_keys(const Key *key, int index)
void BKE_mesh_clear_geometry(Mesh *mesh)
void BKE_mesh_face_offsets_ensure_alloc(Mesh *mesh)
void BKE_mesh_runtime_clear_geometry(Mesh *mesh)
void multires_topology_changed(Mesh *mesh)
#define BLI_array_alloca(arr, realsize)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
#define BLI_SCOPED_DEFER(function_to_defer)
#define POINTER_OFFSET(v, ofs)
#define CLOG_WARN(clg_ref,...)
bool DEG_is_original_id(const ID *id)
#define MAX_CUSTOMDATA_LAYER_NAME
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
#define BM_ELEM_CD_GET_BOOL(ele, offset)
#define BM_ELEM_CD_GET_INT(ele, offset)
#define BM_ELEM_CD_SET_INT(ele, offset, f)
#define BM_FACE_FIRST_LOOP(p)
#define BM_ELEM_CD_GET_VOID_P(ele, offset)
BMFace * BM_face_create(BMesh *bm, BMVert *const *verts, BMEdge *const *edges, const int len, const BMFace *f_example, const eBMCreateFlag create_flag)
BMVert * BM_vert_create(BMesh *bm, const float co[3], const BMVert *v_example, const eBMCreateFlag create_flag)
Main function for creating a new vertex.
BMEdge * BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, const BMEdge *e_example, const eBMCreateFlag create_flag)
Main function for creating a new edge.
#define BM_elem_index_get(ele)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_select_history_clear(BMesh *bm)
void BM_face_select_set(BMesh *bm, BMFace *f, const bool select)
Select Face.
void BM_vert_select_set(BMesh *bm, BMVert *v, const bool select)
Select Vert.
void BM_edge_select_set(BMesh *bm, BMEdge *e, const bool select)
Select Edge.
#define BM_select_history_store_notest(bm, ele)
static Vector< MeshToBMeshLayerInfo > mesh_to_bm_copy_info_calc(const CustomData &mesh_data, CustomData &bm_data)
static int bm_to_mesh_shape_layer_index_from_kb(BMesh *bm, KeyBlock *currkey)
void BM_mesh_bm_from_me(BMesh *bm, const Mesh *mesh, const BMeshFromMeshParams *params)
void BM_mesh_bm_to_me_for_eval(BMesh &bm, Mesh &mesh, const CustomData_MeshMasks *cd_mask_extra)
static void bm_to_mesh_shape(BMesh *bm, Key *key, MutableSpan< float3 > positions, const bool active_shapekey_to_mvert)
static BMFace * bm_face_create_from_mpoly(BMesh &bm, Span< int > face_verts, Span< int > face_edges, Span< BMVert * > vtable, Span< BMEdge * > etable)
static void bmesh_to_mesh_calc_object_remap(Main &bmain, Mesh &mesh, BMesh &bm, const int old_totvert)
void BM_mesh_bm_to_me_compact(BMesh &bm, Mesh &mesh, const CustomData_MeshMasks *mask, const bool add_mesh_attributes)
static BMVert ** bm_to_mesh_vertex_map(BMesh *bm, const int old_verts_num)
BMesh -> Mesh.
static Vector< BMeshToMeshLayerInfo > bm_to_mesh_copy_info_calc(const CustomData &bm_data, CustomData &mesh_data)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
static void mesh_attributes_copy_to_bmesh_block(CustomData &data, const Span< MeshToBMeshLayerInfo > copy_info, const int mesh_index, BMHeader &header)
bool BM_attribute_stored_in_bmesh_builtin(const StringRef name)
static void assert_bmesh_has_no_mesh_only_attributes(const BMesh &bm)
void BM_face_normal_update(BMFace *f)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
IndexRange index_range() const
void reinitialize(const int64_t new_size)
constexpr bool is_empty() const
constexpr IndexRange index_range() const
constexpr Span slice(int64_t start, int64_t size) 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 fill(const T &value) const
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type)
draw_view in_light_buf[] float
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
static void bm_to_mesh_loops(const BMesh &bm, const Span< const BMLoop * > bm_loops, Mesh &mesh)
static void bm_to_mesh_verts(const BMesh &bm, const Span< const BMVert * > bm_verts, Mesh &mesh, MutableSpan< bool > select_vert, MutableSpan< bool > hide_vert)
static void bm_to_mesh_edges(const BMesh &bm, const Span< const BMEdge * > bm_edges, Mesh &mesh, MutableSpan< bool > select_edge, MutableSpan< bool > hide_edge, MutableSpan< bool > sharp_edge, MutableSpan< bool > uv_seams)
static void bm_vert_table_build(BMesh &bm, MutableSpan< const BMVert * > table, bool &need_select_vert, bool &need_hide_vert)
static void bm_edge_table_build(BMesh &bm, MutableSpan< const BMEdge * > table, bool &need_select_edge, bool &need_hide_edge, bool &need_sharp_edge, bool &need_uv_seams)
static void bmesh_block_copy_to_mesh_attributes(const Span< BMeshToMeshLayerInfo > copy_info, const int mesh_index, const void *block)
static void bm_face_loop_table_build(BMesh &bm, MutableSpan< const BMFace * > face_table, MutableSpan< const BMLoop * > loop_table, bool &need_select_poly, bool &need_hide_poly, bool &need_sharp_face, bool &need_material_index, Vector< int > &loop_layers_not_to_copy)
static void bm_to_mesh_faces(const BMesh &bm, const Span< const BMFace * > bm_faces, Mesh &mesh, MutableSpan< bool > select_poly, MutableSpan< bool > hide_poly, MutableSpan< bool > sharp_faces, MutableSpan< int > material_indices)
MutableVArraySpan< T > span