14#define DNA_DEPRECATED_ALLOW
88 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
106 std::optional<Library *> owner_library,
111 Mesh *mesh_dst =
reinterpret_cast<Mesh *
>(id_dst);
112 const Mesh *mesh_src =
reinterpret_cast<const Mesh *
>(id_src);
115 mesh_dst->
runtime->deformed_only = mesh_src->
runtime->deformed_only;
116 mesh_dst->
runtime->wrapper_type = mesh_src->
runtime->wrapper_type;
117 mesh_dst->
runtime->subsurf_runtime_data = mesh_src->
runtime->subsurf_runtime_data;
118 mesh_dst->
runtime->cd_mask_extra = mesh_src->
runtime->cd_mask_extra;
122 mesh_dst->
runtime->subsurf_face_dot_tags = mesh_src->
runtime->subsurf_face_dot_tags;
123 mesh_dst->
runtime->subsurf_optimal_display_edges =
124 mesh_src->
runtime->subsurf_optimal_display_edges;
127 mesh_dst->
runtime->deformed_only =
true;
138 mesh_dst->
runtime->is_original_bmesh =
false;
143 mesh_dst->
runtime->bounds_cache = mesh_src->
runtime->bounds_cache;
144 mesh_dst->
runtime->vert_normals_cache = mesh_src->
runtime->vert_normals_cache;
145 mesh_dst->
runtime->face_normals_cache = mesh_src->
runtime->face_normals_cache;
146 mesh_dst->
runtime->corner_normals_cache = mesh_src->
runtime->corner_normals_cache;
147 mesh_dst->
runtime->loose_verts_cache = mesh_src->
runtime->loose_verts_cache;
148 mesh_dst->
runtime->verts_no_face_cache = mesh_src->
runtime->verts_no_face_cache;
149 mesh_dst->
runtime->loose_edges_cache = mesh_src->
runtime->loose_edges_cache;
150 mesh_dst->
runtime->corner_tris_cache = mesh_src->
runtime->corner_tris_cache;
151 mesh_dst->
runtime->corner_tri_faces_cache = mesh_src->
runtime->corner_tri_faces_cache;
152 mesh_dst->
runtime->vert_to_face_offset_cache = mesh_src->
runtime->vert_to_face_offset_cache;
153 mesh_dst->
runtime->vert_to_face_map_cache = mesh_src->
runtime->vert_to_face_map_cache;
154 mesh_dst->
runtime->vert_to_corner_map_cache = mesh_src->
runtime->vert_to_corner_map_cache;
155 mesh_dst->
runtime->corner_to_face_map_cache = mesh_src->
runtime->corner_to_face_map_cache;
156 if (mesh_src->
runtime->bake_materials) {
157 mesh_dst->
runtime->bake_materials = std::make_unique<blender::bke::bake::BakeMaterialsList>(
158 *mesh_src->
runtime->bake_materials);
188 mesh_src->
runtime->face_offsets_sharing_info,
190 &mesh_dst->
runtime->face_offsets_sharing_info);
206 reinterpret_cast<ID **
>(&mesh_dst->
key),
213 mesh->runtime->edit_mesh.reset();
218 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
225 delete mesh->runtime;
230 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
235 for (
int i = 0; i < mesh->totcol; i++) {
246 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
247 if (mesh->corner_data.external) {
249 mesh->corner_data.external->filepath,
250 sizeof(mesh->corner_data.external->filepath));
258 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
267 mesh->mface =
nullptr;
268 mesh->totface_legacy = 0;
269 memset(&mesh->fdata_legacy, 0,
sizeof(mesh->fdata_legacy));
274 memset(&mesh->vert_data, 0,
sizeof(mesh->vert_data));
277 memset(&mesh->edge_data, 0,
sizeof(mesh->edge_data));
279 mesh->corners_num = 0;
280 memset(&mesh->corner_data, 0,
sizeof(mesh->corner_data));
283 memset(&mesh->face_data, 0,
sizeof(mesh->face_data));
284 mesh->face_offset_indices =
nullptr;
292 mesh_sculpt_mask_to_legacy(vert_layers);
297 mesh->runtime =
nullptr;
310 writer, &mesh->vert_data, vert_layers, mesh->verts_num,
CD_MASK_MESH.
vmask, &mesh->id);
312 writer, &mesh->edge_data, edge_layers, mesh->edges_num,
CD_MASK_MESH.
emask, &mesh->id);
315 writer, &mesh->fdata_legacy, {}, mesh->totface_legacy,
CD_MASK_MESH.
fmask, &mesh->id);
317 writer, &mesh->corner_data, loop_layers, mesh->corners_num,
CD_MASK_MESH.
lmask, &mesh->id);
319 writer, &mesh->face_data, face_layers, mesh->faces_num,
CD_MASK_MESH.
pmask, &mesh->id);
321 if (mesh->face_offset_indices) {
324 mesh->face_offset_indices,
325 sizeof(
int) * mesh->faces_num,
327 [&]() { BLO_write_int32_array(writer, mesh->faces_num + 1, mesh->face_offset_indices); });
333 Mesh *mesh =
reinterpret_cast<Mesh *
>(id);
359 if (mesh->deform_verts().is_empty()) {
367 mesh->texspace_flag &= ~ME_TEXSPACE_FLAG_AUTO_EVALUATED;
371 if (mesh->face_offset_indices) {
373 reader, &mesh->face_offset_indices, [&]() {
374 BLO_read_int32_array(reader, mesh->faces_num + 1, &mesh->face_offset_indices);
375 return blender::implicit_sharing::info_for_mem_free(mesh->face_offset_indices);
379 if (mesh->mselect ==
nullptr) {
384 TFace *tf = mesh->tface;
385 for (
int i = 0; i < mesh->totface_legacy; i++, tf++) {
423 return ELEM(
StringRef(name),
"position",
".corner_vert",
".corner_edge",
".edge_verts");
428 BMesh *
bm = mesh->runtime->edit_mesh ? mesh->runtime->edit_mesh->bm :
nullptr;
461 if (mesh->runtime->edit_mesh) {
483 if (mesh.default_color_attribute) {
527 if (mesh.face_offset_indices) {
529 &mesh.runtime->face_offsets_sharing_info);
535 mesh.totface_legacy = 0;
536 mesh.corners_num = 0;
564 if (free_customdata) {
571 mesh->totface_legacy = 0;
581 BLI_assert(mesh->face_offset_indices ==
nullptr);
582 BLI_assert(mesh->runtime->face_offsets_sharing_info ==
nullptr);
583 if (mesh->faces_num == 0) {
586 mesh->face_offset_indices =
static_cast<int *
>(
589 mesh->face_offset_indices);
593 mesh->face_offsets_for_write().fill(-1);
596 mesh->face_offset_indices[0] = 0;
597 mesh->face_offset_indices[mesh->faces_num] = mesh->corners_num;
602 return {
static_cast<const float3 *
>(
615 return {
static_cast<const int2 *
>(
626OffsetIndices<int> Mesh::faces()
const
649 return {
static_cast<const int *
>(
662 return {
static_cast<const int *
>(
697 this->face_offsets().size_in_bytes());
707 const int corners_num)
713 mesh->verts_num = verts_num;
714 mesh->edges_num = edges_num;
715 mesh->faces_num = faces_num;
716 mesh->corners_num = corners_num;
729 const int corners_num)
732 mesh->verts_num = verts_num;
733 mesh->edges_num = edges_num;
734 mesh->corners_num = corners_num;
791 if (me_dst->
mat !=
nullptr) {
801 const int tessface_num,
803 const int corners_num,
807 const bool do_tessface = (tessface_num ||
853 const int corners_num)
861 return reinterpret_cast<Mesh *
>(
879 const bool add_key_index,
884 bmesh_from_mesh_params.calc_vert_normal =
false;
885 bmesh_from_mesh_params.add_key_index = add_key_index;
886 bmesh_from_mesh_params.use_shapekey =
true;
887 bmesh_from_mesh_params.active_shapekey = ob->
shapenr;
893 const Mesh *me_settings)
904 const Mesh *me_settings)
941 float texspace_location[3], texspace_size[3];
944 texspace_size[0] = (
bounds.max[0] -
bounds.min[0]) / 2.0f;
945 texspace_size[1] = (
bounds.max[1] -
bounds.min[1]) / 2.0f;
946 texspace_size[2] = (
bounds.max[2] -
bounds.min[2]) / 2.0f;
948 for (
int a = 0; a < 3; a++) {
949 if (texspace_size[a] == 0.0f) {
950 texspace_size[a] = 1.0f;
952 else if (texspace_size[a] > 0.0f && texspace_size[a] < 0.00001f) {
953 texspace_size[a] = 0.00001f;
955 else if (texspace_size[a] < 0.0f && texspace_size[a] > -0.00001f) {
956 texspace_size[a] = -0.00001f;
960 copy_v3_v3(mesh->texspace_location, texspace_location);
961 copy_v3_v3(mesh->texspace_size, texspace_size);
980 if (r_texspace_location) {
981 copy_v3_v3(r_texspace_location, mesh->texspace_location);
983 if (r_texspace_size) {
984 copy_v3_v3(r_texspace_size, mesh->texspace_size);
989 char **r_texspace_flag,
990 float **r_texspace_location,
991 float **r_texspace_size)
995 if (r_texspace_flag !=
nullptr) {
996 *r_texspace_flag = &mesh->texspace_flag;
998 if (r_texspace_location !=
nullptr) {
999 *r_texspace_location = mesh->texspace_location;
1001 if (r_texspace_size !=
nullptr) {
1002 *r_texspace_size = mesh->texspace_size;
1008 const Mesh *mesh =
static_cast<const Mesh *
>(ob->
data);
1013 result.as_mutable_span().take_front(positions.size()).copy_from(positions);
1014 result.as_mutable_span().drop_front(positions.size()).fill(
float3(0));
1021 float texspace_location[3], texspace_size[3];
1024 mesh->texcomesh ? mesh->texcomesh :
mesh, texspace_location, texspace_size);
1035 co[0] = (co[0] - texspace_location[0]) / texspace_size[0];
1036 co[1] = (co[1] - texspace_location[1]) / texspace_size[1];
1037 co[2] = (co[2] - texspace_location[2]) / texspace_size[2];
1063 if (ob ==
nullptr) {
1067 return static_cast<Mesh *
>(ob->
data);
1075 Mesh *old =
nullptr;
1077 if (ob ==
nullptr) {
1084 old =
static_cast<Mesh *
>(ob->
data);
1103 if (!material_indices) {
1106 if (material_indices.
domain != AttrDomain::Face) {
1112 if (indices_span[i] > 0 && indices_span[i] >= index) {
1116 indices_span.
save();
1117 material_indices.
finish();
1127 const VArray<int> material_indices = *attributes.lookup_or_default<
int>(
1128 "material_index", AttrDomain::Face, 0);
1133 return indices_span.
contains(index);
1141 attributes.
remove(
"material_index");
1150 const short remap_len_short = short(remap_len);
1152#define MAT_NR_REMAP(n) \
1153 if (n < remap_len_short) { \
1154 BLI_assert(n >= 0 && remap[n] < remap_len_short); \
1159 if (
BMEditMesh *em = mesh->runtime->edit_mesh.get()) {
1170 "material_index", AttrDomain::Face);
1171 if (!material_indices) {
1174 for (
const int i : material_indices.
span.index_range()) {
1177 material_indices.
span.save();
1178 material_indices.
finish();
1189 if (!keep_sharp_edges) {
1190 attributes.
remove(
"sharp_edge");
1192 attributes.remove(
"sharp_face");
1194 attributes.add<
bool>(
"sharp_face",
1203 if (angle >=
M_PI) {
1207 if (angle == 0.0f) {
1211 if (!keep_sharp_edges) {
1212 attributes.remove(
"sharp_edge");
1218 mesh.corner_verts(),
1219 mesh.corner_edges(),
1220 mesh.face_normals(),
1221 mesh.corner_to_face_map(),
1230std::optional<blender::Bounds<blender::float3>> Mesh::bounds_min_max()
const
1235 return std::nullopt;
1238 switch (this->
runtime->wrapper_type) {
1239 case ME_WRAPPER_TYPE_BMESH:
1240 r_bounds = *BKE_editmesh_cache_calc_minmax(*this->runtime->edit_mesh,
1241 *this->runtime->edit_data);
1243 case ME_WRAPPER_TYPE_MDATA:
1244 case ME_WRAPPER_TYPE_SUBD:
1245 r_bounds = *bounds::min_max(this->vert_positions());
1249 return this->
runtime->bounds_cache.data();
1261 for (
float3 &position : positions) {
1265 if (do_keys && mesh->key) {
1267 float *fp = (
float *)kb->data;
1268 for (
int i = kb->totelem; i--; fp += 3) {
1274 mesh->tag_positions_changed();
1280 threading::parallel_for(positions.index_range(), 2048, [&](
const IndexRange range) {
1281 for (float3 &position : positions.slice(range)) {
1282 position += translation;
1294 std::optional<Bounds<float3>>
bounds;
1295 if (mesh->runtime->bounds_cache.is_cached()) {
1296 bounds = mesh->runtime->bounds_cache.data();
1300 if (do_keys && mesh->key) {
1306 mesh->tag_positions_changed_uniformly();
1311 mesh->bounds_set_eager(*
bounds);
1326 mesh->totselect = 0;
1333 MSelect *mselect_src, *mselect_dst;
1336 if (mesh->totselect == 0) {
1340 mselect_src = mesh->mselect;
1342 (mesh->totselect),
sizeof(
MSelect),
"Mesh selection history");
1345 const VArray<bool> select_vert = *attributes.lookup_or_default<
bool>(
1346 ".select_vert", AttrDomain::Point,
false);
1347 const VArray<bool> select_edge = *attributes.lookup_or_default<
bool>(
1348 ".select_edge", AttrDomain::Edge,
false);
1349 const VArray<bool> select_poly = *attributes.lookup_or_default<
bool>(
1350 ".select_poly", AttrDomain::Face,
false);
1352 for (i_src = 0, i_dst = 0; i_src < mesh->totselect; i_src++) {
1353 int index = mselect_src[i_src].
index;
1354 switch (mselect_src[i_src].type) {
1356 if (select_vert[index]) {
1357 mselect_dst[i_dst] = mselect_src[i_src];
1363 if (select_edge[index]) {
1364 mselect_dst[i_dst] = mselect_src[i_src];
1370 if (select_poly[index]) {
1371 mselect_dst[i_dst] = mselect_src[i_src];
1387 mselect_dst =
nullptr;
1389 else if (i_dst != mesh->totselect) {
1393 mesh->totselect = i_dst;
1394 mesh->mselect = mselect_dst;
1401 for (
int i = 0; i < mesh->totselect; i++) {
1402 if ((mesh->mselect[i].index == index) && (mesh->mselect[i].type == type)) {
1414 if (mesh->totselect) {
1415 if (mesh->mselect[mesh->totselect - 1].type == type) {
1416 return mesh->mselect[mesh->totselect - 1].index;
1426 if (msel_index == -1) {
1429 sizeof(
MSelect) * (mesh->totselect + 1));
1430 mesh->mselect[mesh->totselect].index = index;
1431 mesh->mselect[mesh->totselect].type = type;
1434 else if (msel_index != mesh->totselect - 1) {
1436 std::swap(mesh->mselect[msel_index], mesh->mselect[mesh->totselect - 1]);
1439 BLI_assert((mesh->mselect[mesh->totselect - 1].index == index) &&
1440 (mesh->mselect[mesh->totselect - 1].type == type));
1445 r_count[0] = r_count[1] = r_count[2] = 0;
1446 if (mesh->runtime->edit_mesh) {
1447 BMesh *
bm = mesh->runtime->edit_mesh->bm;
1464 if (mesh->runtime->mesh_eval !=
nullptr) {
1466 mesh->runtime->mesh_eval =
nullptr;
#define ATTR_DOMAIN_MASK_COLOR
#define ATTR_DOMAIN_AS_MASK(domain)
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path, size_t path_maxncpy)
void CustomData_blend_write_prepare(CustomData &data, blender::Vector< CustomDataLayer, 16 > &layers_to_write, const blender::Set< std::string > &skip_names={})
void CustomData_count_memory(const CustomData &data, int totelem, blender::MemoryCounter &memory)
const CustomData_MeshMasks CD_MASK_EVERYTHING
void * CustomData_get_layer_named_for_write(CustomData *data, eCustomDataType type, blender::StringRef name, int totelem)
bool CustomData_free_layer_named(CustomData *data, blender::StringRef name, const int totelem)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
const void * CustomData_get_layer_named(const CustomData *data, eCustomDataType type, blender::StringRef name)
void CustomData_MeshMasks_update(CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
void CustomData_reset(CustomData *data)
void * CustomData_bmesh_get(const CustomData *data, void *block, eCustomDataType type)
void CustomData_blend_write(BlendWriter *writer, CustomData *data, blender::Span< CustomDataLayer > layers_to_write, int count, eCustomDataMask cddata_mask, ID *id)
void CustomData_init_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, int totelem)
void CustomData_free(CustomData *data, int totelem)
void CustomData_blend_read(BlendDataReader *reader, CustomData *data, int count)
void CustomData_init_layout_from(const CustomData *source, CustomData *dest, eCustomDataMask mask, eCDAllocType alloctype, int totelem)
void * CustomData_get_layer_for_write(CustomData *data, eCustomDataType type, int totelem)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
const CustomData_MeshMasks CD_MASK_DERIVEDMESH
#define CD_TYPE_AS_MASK(_type)
const CustomData_MeshMasks CD_MASK_MESH
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
const char * BKE_idtype_idcode_to_name(short idcode)
void * BKE_libblock_alloc(Main *bmain, short type, const char *name, int flag) ATTR_WARN_UNUSED_RESULT
void BKE_id_free(Main *bmain, void *idv)
void BKE_libblock_init_empty(ID *id) ATTR_NONNULL(1)
struct ID * BKE_id_copy_in_lib(Main *bmain, std::optional< Library * > owner_library, const ID *id, const ID *new_owner_id, ID **new_id_p, int flag)
ID * BKE_id_copy_ex(Main *bmain, const ID *id, ID **new_id_p, int flag)
void * BKE_id_new(Main *bmain, short type, const char *name)
void * BKE_id_new_nomain(short type, const char *name)
void BKE_id_blend_write(BlendWriter *writer, ID *id)
#define BKE_LIB_FOREACHID_PROCESS_IDSUPER(data_, id_super_, cb_flag_)
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
@ IDWALK_DO_DEPRECATED_POINTERS
#define BKE_LIB_FOREACHID_PROCESS_ID_NOCHECK(data_, id_, cb_flag_)
General operations, lookup, etc. for materials.
void BKE_object_materials_test(struct Main *bmain, struct Object *ob, struct ID *id)
Mesh * BKE_mesh_new_nomain(int verts_num, int edges_num, int faces_num, int corners_num)
void BKE_mesh_runtime_clear_cache(Mesh *mesh)
int BKE_mesh_wrapper_vert_len(const Mesh *mesh)
void BKE_modifiers_test_object(Object *ob)
void multires_force_sculpt_rebuild(Object *object)
General operations, lookup, etc. for blender objects.
#define BLI_assert_unreachable()
void BLI_endian_switch_uint32_array(unsigned int *val, int size) ATTR_NONNULL(1)
BLI_INLINE unsigned int BLI_hash_int(unsigned int k)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
void range_vn_i(int *array_tar, int size, int start)
void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Platform independent time functions.
long int BLI_time_now_seconds_i(void)
#define MEMCMP_STRUCT_AFTER_IS_ZERO(struct_var, member)
#define MEMCPY_STRUCT_AFTER(struct_dst, struct_src, member)
#define BLO_write_id_struct(writer, struct_name, id_address, id)
void BLO_read_string(BlendDataReader *reader, char **ptr_p)
void BLO_write_string(BlendWriter *writer, const char *data_ptr)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
#define BLO_read_struct_list(reader, struct_name, list)
#define BLO_read_struct_array(reader, struct_name, array_size, ptr_p)
void BLO_read_pointer_array(BlendDataReader *reader, int array_size, void **ptr_p)
bool BLO_write_is_undo(BlendWriter *writer)
void BLO_write_shared(BlendWriter *writer, const void *data, size_t approximate_size_in_bytes, const blender::ImplicitSharingInfo *sharing_info, blender::FunctionRef< void()> write_fn)
const blender::ImplicitSharingInfo * BLO_read_shared(BlendDataReader *reader, T **data_ptr, blender::FunctionRef< const blender::ImplicitSharingInfo *()> read_fn)
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
#define BLT_I18NCONTEXT_ID_MESH
bool DEG_is_active(const Depsgraph *depsgraph)
void DEG_debug_print_eval(Depsgraph *depsgraph, const char *function_name, const char *object_name, const void *object_address)
ID * DEG_get_original_id(ID *id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
#define CD_MASK_COLOR_ALL
#define DNA_struct_default_get(struct_name)
@ ME_TEXSPACE_FLAG_AUTO_EVALUATED
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
#define MEM_reallocN(vmemh, len)
bool BKE_mesh_attribute_required(const char *name)
void BKE_mesh_mselect_clear(Mesh *mesh)
void BKE_mesh_copy_parameters_for_eval(Mesh *me_dst, const Mesh *me_src)
void BKE_mesh_orco_verts_transform(Mesh *mesh, MutableSpan< float3 > orco, const bool invert)
void BKE_mesh_tessface_clear(Mesh *mesh)
void BKE_mesh_ensure_skin_customdata(Mesh *mesh)
Mesh * BKE_mesh_new_nomain(const int verts_num, const int edges_num, const int faces_num, const int corners_num)
Mesh * BKE_mesh_from_bmesh_nomain(BMesh *bm, const BMeshToMeshParams *params, const Mesh *me_settings)
void BKE_mesh_clear_geometry_and_metadata(Mesh *mesh)
void BKE_mesh_translate(Mesh *mesh, const float offset[3], const bool do_keys)
int BKE_mesh_mselect_active_get(const Mesh *mesh, int type)
static void mesh_blend_write(BlendWriter *writer, ID *id, const void *id_address)
void BKE_mesh_orco_ensure(Object *ob, Mesh *mesh)
static void mesh_foreach_path(ID *id, BPathForeachPathData *bpath_data)
void BKE_mesh_count_selected_items(const Mesh *mesh, int r_count[3])
Mesh * BKE_mesh_new_nomain_from_template(const Mesh *me_src, const int verts_num, const int edges_num, const int faces_num, const int corners_num)
bool BKE_mesh_has_custom_loop_normals(Mesh *mesh)
void BKE_mesh_texspace_ensure(Mesh *mesh)
void BKE_mesh_mselect_active_set(Mesh *mesh, int index, int type)
Mesh * BKE_mesh_add(Main *bmain, const char *name)
void BKE_mesh_assign_object(Main *bmain, Object *ob, Mesh *mesh)
bool BKE_mesh_material_index_used(Mesh *mesh, short index)
void BKE_mesh_copy_parameters(Mesh *me_dst, const Mesh *me_src)
static void copy_attribute_names(const Mesh &mesh_src, Mesh &mesh_dst)
Mesh * BKE_mesh_copy_for_eval(const Mesh &source)
static void mesh_clear_geometry(Mesh &mesh)
void BKE_mesh_mselect_validate(Mesh *mesh)
static void mesh_free_data(ID *id)
void BKE_mesh_free_editmesh(Mesh *mesh)
BMesh * BKE_mesh_to_bmesh(Mesh *mesh, Object *ob, const bool add_key_index, const BMeshCreateParams *params)
static void clear_attribute_names(Mesh &mesh)
Mesh * BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm, const CustomData_MeshMasks *cd_mask_extra, const Mesh *me_settings)
static void ensure_orig_index_layer(CustomData &data, const int size)
static void mesh_blend_read_data(BlendDataReader *reader, ID *id)
static void translate_positions(MutableSpan< float3 > positions, const float3 &translation)
Mesh * BKE_mesh_from_object(Object *ob)
int BKE_mesh_mselect_find(const Mesh *mesh, int index, int type)
static void mesh_init_data(ID *id)
static void mesh_foreach_id(ID *id, LibraryForeachIDData *data)
void BKE_mesh_texspace_get(Mesh *mesh, float r_texspace_location[3], float r_texspace_size[3])
blender::Array< float3 > BKE_mesh_orco_verts_get(const Object *ob)
static void mesh_tessface_clear_intern(Mesh *mesh, int free_customdata)
void BKE_mesh_material_index_clear(Mesh *mesh)
void BKE_mesh_free_data_for_undo(Mesh *mesh)
void BKE_mesh_material_index_remove(Mesh *mesh, short index)
void BKE_mesh_texspace_get_reference(Mesh *mesh, char **r_texspace_flag, float **r_texspace_location, float **r_texspace_size)
void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh)
static void mesh_copy_data(Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, const int flag)
void BKE_mesh_clear_geometry(Mesh *mesh)
void BKE_mesh_face_offsets_ensure_alloc(Mesh *mesh)
BMesh * BKE_mesh_to_bmesh_ex(const Mesh *mesh, const BMeshCreateParams *create_params, const BMeshFromMeshParams *convert_params)
void BKE_mesh_material_remap(Mesh *mesh, const uint *remap, uint remap_len)
Mesh * BKE_mesh_new_nomain_from_template_ex(const Mesh *me_src, const int verts_num, const int edges_num, const int tessface_num, const int faces_num, const int corners_num, const CustomData_MeshMasks mask)
void BKE_mesh_ensure_default_orig_index_customdata(Mesh *mesh)
void BKE_mesh_ensure_default_orig_index_customdata_no_check(Mesh *mesh)
void BKE_mesh_texspace_calc(Mesh *mesh)
void BKE_mesh_transform(Mesh *mesh, const float mat[4][4], bool do_keys)
void BM_data_layer_add(BMesh *bm, CustomData *data, int type)
#define BM_ITER_MESH(ele, iter, bm, itype)
ATTR_WARN_UNUSED_RESULT BMesh * bm
BMesh * BM_mesh_create(const BMAllocTemplate *allocsize, const BMeshCreateParams *params)
BMesh Make Mesh.
#define BMALLOC_TEMPLATE_FROM_ME(...)
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)
void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *mesh, const BMeshToMeshParams *params)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
constexpr IndexRange index_range() const
constexpr void copy_from(Span< T > values) const
constexpr bool contains(const T &value) const
T get_internal_single() const
bool remove(const StringRef attribute_id)
void add_shared(const ImplicitSharingInfo *sharing_info, const FunctionRef< void(MemoryCounter &shared_memory)> count_fn)
const Depsgraph * depsgraph
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void edges_sharp_from_angle_set(OffsetIndices< int > faces, Span< int > corner_verts, Span< int > corner_edges, Span< float3 > face_normals, Span< int > corner_to_face, Span< bool > sharp_faces, const float split_angle, MutableSpan< bool > sharp_edges)
bool attribute_name_is_anonymous(const StringRef name)
void mesh_sharp_edges_set_from_angle(Mesh &mesh, float angle, bool keep_sharp_edges=false)
void mesh_smooth_set(Mesh &mesh, bool use_smooth, bool keep_sharp_edges=false)
void mesh_ensure_default_color_attribute_on_add(Mesh &mesh, StringRef id, AttrDomain domain, eCustomDataType data_type)
Mesh * mesh_new_no_attributes(int verts_num, int edges_num, int faces_num, int corners_num)
void mesh_ensure_required_data_layers(Mesh &mesh)
void copy_shared_pointer(T *src_ptr, const ImplicitSharingInfo *src_sharing_info, T **r_dst_ptr, const ImplicitSharingInfo **r_dst_sharing_info)
const ImplicitSharingInfo * info_for_mem_free(void *data)
void free_shared_data(T **data, const ImplicitSharingInfo **sharing_info)
void make_trivial_data_mutable(T **data, const ImplicitSharingInfo **sharing_info, const int64_t size)
float remesh_voxel_adaptivity
MeshRuntimeHandle * runtime
char * default_color_attribute
ListBase vertex_group_names
int * face_offset_indices
int attributes_active_index
int vertex_group_active_index
int face_sets_color_default
float texspace_location[3]
char * active_color_attribute
VMutableArray< T > varray
const ImplicitSharingInfo * face_offsets_sharing_info
MutableVArraySpan< T > span