Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_key_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "BLI_bitmap.h"
#include "BLI_edgehash.h"
#include "BLI_endian_switch.h"
#include "BLI_ghash.h"
#include "BLI_hash.h"
#include "BLI_index_range.hh"
#include "BLI_linklist.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_math_vector.hh"
#include "BLI_memarena.h"
#include "BLI_string.h"
#include "BLI_task.hh"
#include "BLI_utildefines.h"
#include "BLI_vector.hh"
#include "BLT_translation.h"
#include "BKE_anim_data.h"
#include "BKE_bpath.h"
#include "BKE_deform.h"
#include "BKE_editmesh.h"
#include "BKE_global.h"
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_mesh_legacy_convert.h"
#include "BKE_mesh_runtime.h"
#include "BKE_mesh_wrapper.h"
#include "BKE_modifier.h"
#include "BKE_multires.h"
#include "BKE_object.h"
#include "PIL_time.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "BLO_read_write.h"
Go to the source code of this file.
Classes | |
struct | SplitFaceNewVert |
struct | SplitFaceNewEdge |
Macros | |
#define | DNA_DEPRECATED_ALLOW |
#define | MAT_NR_REMAP(n) |
Variables | |
IDTypeInfo | IDType_ID_ME |
#define MAT_NR_REMAP | ( | n | ) |
anonymous enum |
Definition at line 963 of file mesh.cc.
References BKE_id_new(), and ID_ME.
Referenced by BKE_mesh_new_from_object_to_bmain(), BKE_object_obdata_add_from_type(), BKE_pointcloud_to_mesh(), blender::io::usd::USDMeshReader::create_object(), Freestyle::BlenderStrokeRenderer::NewMesh(), object_convert_exec(), blender::io::stl::read_stl_ascii(), blender::io::stl::read_stl_binary(), blender::io::alembic::AbcMeshReader::readObjectData(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::io::alembic::AbcPointsReader::readObjectData(), blender::bke::tests::MeshTestData::setup(), blender::bke::tests::TwoMeshesTestData::setup(), blender::bke::tests::TEST(), blender::io::stl::STLMeshHelper::to_mesh(), and MeshImporter::write_geometry().
Definition at line 1377 of file mesh.cc.
References BKE_modifiers_test_object(), BKE_object_materials_test(), Object::data, Mesh::id, id_us_min(), id_us_plus(), if(), multires_force_sculpt_rebuild(), OB_MESH, and Object::type.
Referenced by MeshImporter::create_mesh_object(), and blender::io::stl::importer_main().
void BKE_mesh_auto_smooth_flag_set | ( | Mesh * | me, |
const bool | use_auto_smooth, | ||
const float | auto_smooth_angle | ||
) |
Definition at line 1500 of file mesh.cc.
References Mesh::flag, ME_AUTOSMOOTH, and Mesh::smoothresh.
Referenced by shade_smooth_exec().
Definition at line 1207 of file mesh.cc.
References Object_Runtime::bb, BKE_boundbox_init_from_minmax(), BKE_mesh_wrapper_minmax(), BOUNDBOX_DIRTY, Object::data, BoundBox::flag, INIT_MINMAX, max, MEM_mallocN, min, and Object::runtime.
Referenced by BKE_object_boundbox_get(), BKE_object_minmax(), blender::io::obj::transform_object(), and voxel_size_edit_invoke().
Definition at line 1911 of file mesh.cc.
References BKE_mesh_calc_normals_split_ex(), ensure_corner_normal_layer(), and mesh.
Referenced by GeometryExporter::create_normals(), displaceModifier_do(), editbmesh_calc_modifier_final_normals(), blender::io::obj::OBJMesh::ensure_mesh_normals(), blender::ed::sculpt_paint::AddOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::ed::sculpt_paint::SlideOperationExecutor::execute(), blender::io::alembic::get_loop_normals(), Freestyle::BlenderFileLoader::insertShapeNode(), mesh_calc_modifier_final_normals(), mesh_calc_tri_tessface(), mesh_wrapper_ensure_subdivision(), modifyMesh(), and triangulate_mesh().
void BKE_mesh_calc_normals_split_ex | ( | struct Mesh * | mesh, |
struct MLoopNorSpaceArray * | r_lnors_spacearr, | ||
float(*) | r_corner_normals[3] | ||
) |
Compute 'split' (aka loop, or per face corner's) normals.
r_lnors_spacearr | Allows to get computed loop normal space array. That data, among other things, contains 'smooth fan' info, useful e.g. to split geometry along sharp edges. |
Definition at line 1875 of file mesh.cc.
References BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_normals_loop_split(), BKE_mesh_poly_normals_ensure(), BKE_mesh_vertex_normals_ensure(), CD_CUSTOMLOOPNORMAL, CustomData_get_layer(), Mesh::flag, Mesh::ldata, M_PI, ME_AUTOSMOOTH, Mesh::medge, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, Mesh::smoothresh, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_mesh_calc_normals_split(), BKE_mesh_split_faces(), and blender::nodes::node_geo_deform_curves_on_surface_cc::node_geo_exec().
Definition at line 838 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_free(), CD_FACEMAP, CustomData_free_layers(), CustomData_has_layer(), Mesh::edit_mesh, BMesh::pdata, Mesh::pdata, and Mesh::totpoly.
Definition at line 941 of file mesh.cc.
References BKE_animdata_free(), BKE_mesh_runtime_clear_cache(), Mesh::id, mesh, and mesh_clear_geometry().
Used for unit testing; compares two meshes, checking only differences we care about. should be usable with leaf's testing framework I get RNA work done, will use hackish testing code for now.
Definition at line 702 of file mesh.cc.
References Freestyle::c, cmpcode_to_str(), customdata_compare(), Mesh::edata, Mesh::ldata, Mesh::pdata, Mesh::totedge, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Definition at line 1126 of file mesh.cc.
References BKE_id_copy_ex(), Mesh::id, LIB_ID_COPY_CD_REFERENCE, LIB_ID_COPY_LOCALIZE, and result.
Definition at line 1017 of file mesh.cc.
References copy_v3_v3(), Mesh::editflag, Mesh::face_sets_color_default, Mesh::face_sets_color_seed, Mesh::flag, Mesh::loc, Mesh::remesh_mode, Mesh::remesh_voxel_adaptivity, Mesh::remesh_voxel_size, Mesh::size, Mesh::smoothresh, Mesh::symmetry, Mesh::texflag, and Mesh::vertex_group_active_index.
Referenced by BKE_mesh_copy_parameters_for_eval().
Definition at line 1039 of file mesh.cc.
References BKE_defgroup_copy_list(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_copy_parameters(), BLI_assert, BLI_listbase_is_empty(), Mesh::id, LIB_TAG_COPIED_ON_WRITE, LIB_TAG_NO_MAIN, Mesh::mat, MEM_dupallocN, MEM_freeN, ID::tag, Mesh::totcol, and Mesh::vertex_group_names.
Referenced by BKE_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_from_bmesh_nomain(), and BKE_mesh_new_nomain_from_template_ex().
Definition at line 1804 of file mesh.cc.
References BMEditMesh::bm, bm, Mesh::edit_mesh, mesh, BMesh::totedgesel, BMesh::totfacesel, and BMesh::totvertsel.
Definition at line 1659 of file mesh.cc.
References MEdge::bweight, Mesh::cd_flag, MEdge::crease, ME_CDFLAG_EDGE_BWEIGHT, ME_CDFLAG_EDGE_CREASE, ME_CDFLAG_VERT_BWEIGHT, Mesh::medge, mesh, Mesh::mvert, and UNLIKELY.
Referenced by blo_do_versions_260().
int BKE_mesh_edge_other_vert | ( | const MEdge * | e, |
int | v | ||
) |
Add original index (CD_ORIGINDEX) layers if they don't already exist. This is meant to be used when creating an evaluated mesh from an original edit mode mesh, to allow mapping from the evaluated vertices to the originals.
The mesh is expected to of a ME_WRAPPER_TYPE_MDATA
wrapper type. This is asserted.
Definition at line 1194 of file mesh.cc.
References BKE_mesh_ensure_default_orig_index_customdata_no_check(), BLI_assert, ME_WRAPPER_TYPE_MDATA, mesh, Mesh::runtime, and Mesh_Runtime::wrapper_type.
Referenced by create_orco_mesh(), and editbmesh_calc_modifiers().
Same as BKE_mesh_ensure_default_orig_index_customdata but does not perform any checks: they must be done by the caller.
Definition at line 1200 of file mesh.cc.
References Mesh::edata, ensure_orig_index_layer(), mesh, Mesh::pdata, Mesh::totedge, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_ensure_default_orig_index_customdata().
Definition at line 819 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_add(), CD_DEFAULT, CD_FACEMAP, CustomData_add_layer(), CustomData_has_layer(), Mesh::edit_mesh, BMesh::pdata, Mesh::pdata, and Mesh::totpoly.
Definition at line 786 of file mesh.cc.
References BMEditMesh::bm, bm, BM_data_layer_add(), BM_ITER_MESH, BM_VERTS_OF_MESH, CD_DEFAULT, CD_MVERT_SKIN, CustomData_add_layer(), CustomData_bmesh_get(), CustomData_has_layer(), BMHeader::data, Mesh::edit_mesh, MVertSkin::flag, BMVert::head, MVERT_SKIN_ROOT, Mesh::totvert, v, BMesh::vdata, and Mesh::vdata.
Referenced by BKE_object_copy_modifier(), ED_object_modifier_add(), mesh_customdata_skin_add_exec(), and skin_root_mark_exec().
Definition at line 1117 of file mesh.cc.
References BKE_libblock_free_data(), Mesh::edit_mesh, Mesh::id, MEM_freeN, and mesh_free_data().
Referenced by BKE_object_free_derived_caches(), and object_force_modifier_update_for_bind().
Definition at line 2199 of file mesh.cc.
References BKE_id_free(), BKE_mesh_texspace_calc(), copy_v3_v3(), DEG_debug_print_eval(), DEG_get_original_id(), DEG_is_active(), depsgraph, Mesh::edit_mesh, Mesh::id, Mesh::loc, ME_AUTOSPACE_EVALUATED, mesh, Mesh_Runtime::mesh_eval, ID::name, Mesh::runtime, Mesh::size, and Mesh::texflag.
Referenced by blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock().
Free (or release) any data used by this mesh (does not free the mesh itself). Only use for undo, in most cases BKE_id_free(nullptr, me)
should be used.
Definition at line 903 of file mesh.cc.
References Mesh::id, and mesh_free_data().
Referenced by undomesh_free_data().
Definition at line 169 of file mesh.cc.
References BKE_editmesh_free_data(), Mesh::edit_mesh, BMEditMesh::is_shallow_copy, MEM_freeN, and mesh.
Referenced by editbmesh_build_data(), and mesh_free_data().
Mesh* BKE_mesh_from_bmesh_for_eval_nomain | ( | BMesh * | bm, |
const CustomData_MeshMasks * | cd_mask_extra, | ||
const Mesh * | me_settings | ||
) |
Definition at line 1175 of file mesh.cc.
References BKE_id_new_nomain(), BKE_mesh_copy_parameters_for_eval(), bm, BM_mesh_bm_to_me_for_eval(), ID_ME, and mesh.
Mesh* BKE_mesh_from_bmesh_nomain | ( | BMesh * | bm, |
const struct BMeshToMeshParams * | params, | ||
const Mesh * | me_settings | ||
) |
Definition at line 1164 of file mesh.cc.
References BKE_id_new_nomain(), BKE_mesh_copy_parameters_for_eval(), BLI_assert, bm, BM_mesh_bm_to_me(), ID_ME, mesh, and params.
Definition at line 1365 of file mesh.cc.
References Object::data, OB_MESH, and Object::type.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), build_pbvh_from_ccg(), createTransEdge(), do_paintface_box_select(), ED_mesh_join_objects_exec(), ED_object_sculptmode_enter_ex(), ED_object_sculptmode_exit_ex(), ED_object_texture_paint_mode_enter_ex(), ED_object_texture_paint_mode_exit_ex(), ED_paint_proj_mesh_data_check(), ed_vwpaintmode_enter_generic(), ed_vwpaintmode_exit_generic(), ED_wpaint_ensure_data(), multires_force_external_reload(), multiresModifier_del_levels(), paint_proj_new_stroke(), paintface_deselect_all_visible(), paintface_flush_flags(), paintface_hide(), paintface_minmax(), paintface_mouse_select(), paintface_reveal(), paintface_select_linked(), paintvert_deselect_all_visible(), paintvert_flush_flags(), paintvert_hide(), paintvert_reveal(), paintvert_select_ungrouped(), quadriflow_remesh_exec(), SCULPT_boundary_info_ensure(), sculpt_face_set_grow(), sculpt_face_set_shrink(), sculpt_gesture_apply_trim(), sculpt_gesture_init_face_set_properties(), SCULPT_mesh_symmetry_xyz_get(), vertex_color_brightness_contrast_exec(), vertex_color_hsv_exec(), vertex_color_invert_exec(), vertex_color_levels_exec(), vertex_color_set(), vertex_color_smooth(), vertex_paint_from_weight(), vertex_weight_paint_mode_poll(), vgroup_selected_get(), vpaint_mode_toggle_exec(), vpaint_stroke_test_start(), weight_paint_sample_enum_itemf(), weight_sample_invoke(), wpaint_mode_toggle_exec(), and wpaint_stroke_test_start().
High-level custom normals functions.
Definition at line 894 of file mesh.cc.
References BMEditMesh::bm, CD_CUSTOMLOOPNORMAL, CustomData_has_layer(), Mesh::edit_mesh, BMesh::ldata, and Mesh::ldata.
Referenced by mesh_customdata_custom_splitnormals_add_exec(), and mesh_customdata_custom_splitnormals_clear_exec().
void BKE_mesh_looptri_get_real_edges | ( | const Mesh * | mesh, |
const MLoopTri * | looptri, | ||
int | r_edges[3] | ||
) |
Definition at line 1549 of file mesh.cc.
References e, MLoop::e, Mesh::medge, mesh, Mesh::mloop, MLoopTri::tri, and MLoop::v.
Definition at line 1441 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_clear_id().
Definition at line 1401 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_remove_id().
Definition at line 1420 of file mesh.cc.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by BKE_object_material_slot_used().
Definition at line 1456 of file mesh.cc.
References BMEditMesh::bm, BM_FACES_OF_MESH, BM_ITER_MESH, Mesh::edit_mesh, BMFace::mat_nr, MPoly::mat_nr, MAT_NR_REMAP, Mesh::mpoly, and Mesh::totpoly.
Referenced by BKE_object_material_remap().
Definition at line 1561 of file mesh.cc.
References init, max, min, blender::threading::parallel_reduce(), result, and Mesh::totvert.
int BKE_mesh_mselect_active_get | ( | struct Mesh * | me, |
int | type | ||
) |
Definition at line 1772 of file mesh.cc.
References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.
Referenced by ED_mesh_active_dvert_get_ob().
Definition at line 1784 of file mesh.cc.
References BKE_mesh_mselect_find(), BLI_assert, MSelect::index, MEM_reallocN, Mesh::mselect, SWAP, Mesh::totselect, type, and MSelect::type.
Referenced by ed_wpaint_vertex_select_pick().
Definition at line 1695 of file mesh.cc.
References MEM_SAFE_FREE, Mesh::mselect, and Mesh::totselect.
Referenced by paintvert_deselect_all_visible(), and SCULPT_dynamic_topology_enable_ex().
int BKE_mesh_mselect_find | ( | struct Mesh * | me, |
int | index, | ||
int | type | ||
) |
me->mselect
, or -1 Definition at line 1759 of file mesh.cc.
References BLI_assert, ELEM, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::mselect, Mesh::totselect, type, and MSelect::type.
Referenced by BKE_mesh_mselect_active_set().
Definition at line 1701 of file mesh.cc.
References BLI_assert_unreachable, MVert::flag, MEdge::flag, MPoly::flag, MSelect::index, ME_ESEL, ME_FSEL, ME_VSEL, Mesh::medge, MEM_freeN, MEM_malloc_arrayN, MEM_reallocN, Mesh::mpoly, Mesh::mselect, Mesh::mvert, SELECT, Mesh::totselect, and type.
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), ed_wpaint_vertex_select_pick(), paint_vertsel_circle_select(), and paintvert_deselect_all_visible().
Mesh* BKE_mesh_new_nomain | ( | int | verts_len, |
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len | ||
) |
Definition at line 991 of file mesh.cc.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), BKE_mesh_update_customdata_pointers(), CD_NUMTYPES, copy_vn_i(), Mesh::edata, Mesh::fdata, Mesh::id, ID_ME, Mesh::ldata, LIB_ID_CREATE_LOCALIZE, mesh, mesh_ensure_cdlayers_primary(), Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, CustomData::typemap, and Mesh::vdata.
Referenced by BKE_mesh_new_nomain_from_curve_displist(), blender::nodes::node_geo_curve_fill_cc::cdt_to_mesh(), blender::nodes::node_geo_mesh_primitive_circle_cc::create_circle_mesh(), blender::geometry::create_cuboid_mesh(), blender::nodes::create_cylinder_or_cone_mesh(), create_empty_mesh(), blender::nodes::create_grid_mesh(), blender::nodes::create_line_mesh(), blender::io::obj::MeshFromGeometry::create_mesh(), blender::nodes::node_geo_mesh_primitive_uv_sphere_cc::create_uv_sphere_mesh(), blender::nodes::create_vertex_mesh(), curve_calc_modifiers_post(), blender::bke::curve_to_mesh_sweep(), do_multires_bake(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), evaluate_surface_object(), blender::geometry::execute_realize_mesh_tasks(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), get_quick_mesh(), hair_create_input_mesh(), modifier_modify_mesh_and_geometry_set(), modifyMesh(), multires_unsubdivide_to_basemesh(), blender::io::alembic::AbcPointsReader::read_mesh(), and sculpt_gesture_trim_geometry_generate().
Mesh* BKE_mesh_new_nomain_from_template | ( | const Mesh * | me_src, |
int | verts_len, | ||
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len | ||
) |
Definition at line 1106 of file mesh.cc.
References BKE_mesh_new_nomain_from_template_ex(), and CD_MASK_EVERYTHING.
Mesh* BKE_mesh_new_nomain_from_template_ex | ( | const Mesh * | me_src, |
int | verts_len, | ||
int | edges_len, | ||
int | tessface_len, | ||
int | loops_len, | ||
int | polys_len, | ||
CustomData_MeshMasks | mask | ||
) |
Definition at line 1060 of file mesh.cc.
References BKE_id_new_nomain(), BKE_mesh_copy_parameters_for_eval(), BKE_mesh_update_customdata_pointers(), BKE_mesh_vertex_normals_are_dirty(), BLI_assert, CD_CALLOC, Mesh::cd_flag, CustomData_copy(), Mesh::edata, Mesh::fdata, ID_ME, Mesh::ldata, mask(), MEM_dupallocN, mesh_ensure_cdlayers_primary(), mesh_tessface_clear_intern(), Mesh::mselect, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_new_nomain_from_template().
Add a CD_ORCO layer to the Mesh if there is none already.
Definition at line 1353 of file mesh.cc.
References BKE_mesh_orco_verts_get(), BKE_mesh_orco_verts_transform(), CD_ASSIGN, CD_ORCO, CustomData_add_layer(), CustomData_has_layer(), float(), mesh, Mesh::totvert, and Mesh::vdata.
Referenced by MOD_deform_mesh_eval_get(), and psys_thread_context_init_distribute().
Definition at line 1314 of file mesh.cc.
References Freestyle::a, MVert::co, copy_v3_v3(), float(), MEM_calloc_arrayN, min_ii(), Mesh::texcomesh, and Mesh::totvert.
Referenced by BKE_mesh_orco_ensure(), and get_orco_coords().
Definition at line 1331 of file mesh.cc.
References Freestyle::a, BKE_mesh_texspace_get(), invert(), madd_v3_v3v3v3(), size(), and Mesh::texcomesh.
Referenced by add_orco_mesh(), BKE_mesh_orco_ensure(), distribute_children_exec(), distribute_from_verts_exec(), blender::draw::extract_tan_init_common(), psys_face_mat(), psys_interpolate_face(), psys_mat_hair_to_orco(), psys_particle_on_dm(), psys_thread_context_init_distribute(), blender::io::alembic::read_generated_coordinates(), and blender::io::alembic::write_generated_coordinates().
Definition at line 1486 of file mesh.cc.
References MPoly::flag, ME_SMOOTH, Mesh::mpoly, and Mesh::totpoly.
Referenced by BLO_update_defaults_startup_blend(), modifyMesh(), quadriflow_start_job(), shade_smooth_exec(), and voxel_remesh_exec().
Split faces based on the edge angle and loop normals. Matches behavior of face splitting in render engines.
Definition at line 2121 of file mesh.cc.
References BKE_lnor_spacearr_free(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_calc_normals_split_ex(), BKE_mesh_tessface_clear(), BKE_mesh_update_customdata_pointers(), BKE_mesh_validate(), CD_NORMAL, CustomData_duplicate_referenced_layers(), CustomData_free_layers(), CustomData_realloc(), Mesh::edata, ensure_corner_normal_layer(), float(), Mesh::ldata, MLoopNorSpaceArray::mem, MEM_reallocN, mesh, Mesh::runtime, split_faces_prepare_new_edges(), split_faces_prepare_new_verts(), split_faces_split_new_edges(), split_faces_split_new_verts(), Mesh::totedge, Mesh::totloop, Mesh::totpoly, Mesh::totvert, Mesh::vdata, and Mesh_Runtime::vert_normals.
Referenced by bake_mesh_new_from_object().
Definition at line 1654 of file mesh.cc.
References mesh, and mesh_tessface_clear_intern().
Referenced by BKE_mesh_split_faces(), BKE_sculpt_ensure_orig_mesh_data(), do_versions_after_linking_280(), ED_mesh_join_objects_exec(), ED_mesh_update(), mesh_ensure_tessellation_customdata(), mesh_init_origspace(), and vertex_color_set().
Definition at line 1231 of file mesh.cc.
References Freestyle::a, BKE_mesh_wrapper_minmax(), copy_v3_v3(), INIT_MINMAX, Mesh::loc, max, ME_AUTOSPACE, ME_AUTOSPACE_EVALUATED, mid_v3_v3v3(), min, size(), Mesh::size, and Mesh::texflag.
Referenced by BKE_mesh_eval_geometry(), BKE_mesh_texspace_ensure(), and mesh_copy_texture_space_from_curve_type().
Definition at line 1302 of file mesh.cc.
References BKE_object_obdata_texspace_get(), copy_v3_v3(), Mesh::loc, Mesh::size, and Mesh::texflag.
Referenced by BKE_mesh_nomain_to_mesh(), and mesh_new_from_mball_object().
Definition at line 1268 of file mesh.cc.
References BKE_mesh_texspace_calc(), ME_AUTOSPACE, ME_AUTOSPACE_EVALUATED, and Mesh::texflag.
Referenced by BKE_mesh_texspace_get(), BKE_mesh_texspace_get_reference(), psys_get_texture(), and psys_thread_context_init_distribute().
Definition at line 1275 of file mesh.cc.
References BKE_mesh_texspace_ensure(), copy_v3_v3(), Mesh::loc, and Mesh::size.
Referenced by BKE_mesh_orco_verts_transform().
void BKE_mesh_texspace_get_reference | ( | Mesh * | me, |
char ** | r_texflag, | ||
float ** | r_loc, | ||
float ** | r_size | ||
) |
Definition at line 1287 of file mesh.cc.
References BKE_mesh_texspace_ensure(), Mesh::loc, Mesh::size, and Mesh::texflag.
Referenced by BKE_object_obdata_texspace_get(), drw_call_calc_orco(), and OVERLAY_texture_space().
BMesh* BKE_mesh_to_bmesh | ( | Mesh * | me, |
Object * | ob, | ||
const bool | add_key_index, | ||
const struct BMeshCreateParams * | params | ||
) |
Definition at line 1150 of file mesh.cc.
References BKE_mesh_to_bmesh_ex(), BMeshFromMeshParams::calc_face_normal, params, and Object::shapenr.
Referenced by EDBM_mesh_make().
BMesh* BKE_mesh_to_bmesh_ex | ( | const Mesh * | me, |
const struct BMeshCreateParams * | create_params, | ||
const struct BMeshFromMeshParams * | convert_params | ||
) |
Definition at line 1138 of file mesh.cc.
References bm, BM_mesh_bm_from_me(), BM_mesh_create(), and BMALLOC_TEMPLATE_FROM_ME.
Referenced by BKE_mesh_to_bmesh().
Definition at line 1594 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, CD_NORMAL, MVert::co, copy_m3_m4(), CustomData_duplicate_referenced_layer(), float(), Mesh::key, Mesh::ldata, LISTBASE_FOREACH, mul_m3_v3(), mul_m4_v3(), normalize_m3(), Mesh::totloop, Mesh::totvert, and Mesh::vdata.
Referenced by apply_objects_internal(), and blender::nodes::transform_mesh().
Definition at line 1632 of file mesh.cc.
References add_v3_v3(), BKE_mesh_tag_coords_changed_uniformly(), BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, CustomData_duplicate_referenced_layer(), Mesh::key, LISTBASE_FOREACH, Mesh::mvert, offset, Mesh::totvert, and Mesh::vdata.
Referenced by generate_bounding_box_mesh(), blender::nodes::node_geo_mesh_primitive_cone_cc::node_geo_exec(), object_origin_set_exec(), and blender::nodes::translate_mesh().
Definition at line 874 of file mesh.cc.
References CD_MCOL, CD_MDEFORMVERT, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MLOOPUV, CD_MPOLY, CD_MTFACE, CD_MVERT, CD_PROP_BYTE_COLOR, CustomData_get_layer(), Mesh::dvert, Mesh::edata, Mesh::fdata, Mesh::ldata, Mesh::mcol, Mesh::medge, mesh_update_linked_customdata(), Mesh::mface, Mesh::mloop, Mesh::mloopcol, Mesh::mloopuv, Mesh::mpoly, Mesh::mtface, Mesh::mvert, Mesh::pdata, and Mesh::vdata.
Referenced by add_orco_mesh(), BKE_mesh_convert_mfaces_to_mpolys(), BKE_mesh_do_versions_convert_mfaces_to_mpolys(), BKE_mesh_from_metaball(), BKE_mesh_new_nomain(), BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_nomain_to_mesh(), BKE_mesh_split_faces(), BKE_mesh_tessface_calc(), BKE_mesh_transform(), BKE_mesh_translate(), BKE_sculpt_color_layer_create_if_needed(), blo_do_versions_280(), BM_mesh_bm_to_me(), BM_mesh_bm_to_me_for_eval(), blender::bke::create_attribute_providers_for_mesh(), customdata_version_242(), delete_customdata_layer(), ED_mesh_color_add(), ED_mesh_color_ensure(), ED_mesh_join_objects_exec(), ED_mesh_sculpt_color_add(), ED_mesh_sculpt_color_ensure(), ED_mesh_uv_add(), blender::nodes::node_geo_extrude_mesh_cc::expand_mesh(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), blender::ed::geometry::geometry_color_attribute_remove_exec(), hair_create_input_mesh(), mesh_add_edges(), mesh_add_loops(), mesh_add_polys(), mesh_add_verts(), mesh_clear_geometry(), mesh_copy_data(), SCULPT_dynamic_topology_disable_ex(), sculpt_undo_geometry_restore_data(), um_arraystore_compact_ex(), and um_arraystore_expand().
Definition at line 1824 of file mesh.cc.
References BKE_mesh_vert_coords_get(), float(), MEM_mallocN, mesh, and Mesh::totvert.
Definition at line 1834 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), CD_MVERT, copy_v3_v3(), CustomData_duplicate_referenced_layer(), mesh, Mesh::mvert, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_create_derived_for_modifier(), BKE_shrinkwrap_mesh_nearest_surface_deform(), BKE_shrinkwrap_remesh_target_project(), create_orco_mesh(), curve_calc_modifiers_post(), deformVerts(), do_hair_dynamics(), ED_object_data_xform_restore(), editbmesh_calc_modifiers(), mesh_calc_modifiers(), and MOD_deform_mesh_eval_get().
void BKE_mesh_vert_coords_apply_with_mat4 | ( | Mesh * | mesh, |
const float(*) | vert_coords[3], | ||
const float | mat[4][4] | ||
) |
Definition at line 1846 of file mesh.cc.
References BKE_mesh_tag_coords_changed(), CD_MVERT, CustomData_duplicate_referenced_layer(), mesh, mul_v3_m4v3(), Mesh::mvert, Mesh::totvert, and Mesh::vdata.
Referenced by ED_object_data_xform_by_mat4().
Definition at line 1816 of file mesh.cc.
References copy_v3_v3(), mesh, Mesh::mvert, and Mesh::totvert.
Referenced by BKE_mesh_vert_coords_alloc().
|
static |
Definition at line 409 of file mesh.cc.
References MESHCMP_ATTRIBUTE_VALUE_MISMATCH, MESHCMP_CDLAYERS_MISMATCH, MESHCMP_DVERT_GROUPMISMATCH, MESHCMP_DVERT_TOTGROUPMISMATCH, MESHCMP_DVERT_WEIGHTMISMATCH, MESHCMP_EDGEUNKNOWN, MESHCMP_LOOPCOLMISMATCH, MESHCMP_LOOPMISMATCH, MESHCMP_LOOPUVMISMATCH, MESHCMP_POLYMISMATCH, MESHCMP_POLYVERTMISMATCH, and MESHCMP_VERTCOMISMATCH.
Referenced by BKE_mesh_cmp().
|
static |
Thresh is threshold for comparing vertices, UV's, vertex colors, weights, etc.
Definition at line 442 of file mesh.cc.
References MLoopCol::a, CustomDataLayer::anonymous_id, MLoopCol::b, BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new_ex(), CD_MASK_MDEFORMVERT, CD_MASK_MEDGE, CD_MASK_MLOOPUV, CD_MASK_MPOLY, CD_MASK_MVERT, CD_MASK_PROP_ALL, CD_MASK_PROP_BYTE_COLOR, CD_MDEFORMVERT, CD_MEDGE, CD_MLOOP, CD_MLOOPUV, CD_MPOLY, CD_MVERT, CD_PROP_BOOL, CD_PROP_BYTE_COLOR, CD_PROP_COLOR, CD_PROP_FLOAT, CD_PROP_FLOAT2, CD_PROP_FLOAT3, CD_PROP_INT32, CD_PROP_INT8, CD_TYPE_AS_MASK, BMVert::co, color, compare_threshold_relative(), CustomDataLayer::data, MDeformWeight::def_nr, MDeformVert::dw, fabsf, float(), MLoopCol::g, i1, CustomData::layers, len_squared_v2v2(), MPoly::loopstart, MESHCMP_ATTRIBUTE_VALUE_MISMATCH, MESHCMP_CDLAYERS_MISMATCH, MESHCMP_DVERT_GROUPMISMATCH, MESHCMP_DVERT_TOTGROUPMISMATCH, MESHCMP_DVERT_WEIGHTMISMATCH, MESHCMP_EDGEUNKNOWN, MESHCMP_LOOPCOLMISMATCH, MESHCMP_LOOPMISMATCH, MESHCMP_LOOPUVMISMATCH, MESHCMP_POLYMISMATCH, MESHCMP_POLYVERTMISMATCH, MESHCMP_VERTCOMISMATCH, Mesh::mloop, CustomDataLayer::name, MLoopCol::r, STREQ, Mesh::totedge, CustomData::totlayer, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Mesh::totvert, MDeformVert::totweight, CustomDataLayer::type, MLoopUV::uv, MLoop::v, v1, MEdge::v1, v2, MEdge::v2, and MDeformWeight::weight.
Referenced by BKE_mesh_cmp().
Definition at line 1860 of file mesh.cc.
References CD_CALLOC, CD_FLAG_TEMPORARY, CD_NORMAL, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), CustomData_set_layer_flag(), float(), Mesh::ldata, mesh, and Mesh::totloop.
Referenced by BKE_mesh_calc_normals_split(), and BKE_mesh_split_faces().
|
static |
Definition at line 1185 of file mesh.cc.
References CD_DEFAULT, CD_ORIGINDEX, CustomData_add_layer(), CustomData_has_layer(), data, indices, range_vn_i(), and size().
Referenced by BKE_mesh_ensure_default_orig_index_customdata_no_check().
|
static |
Definition at line 279 of file mesh.cc.
References Mesh::adt, BKE_animdata_blend_read_data(), BKE_defvert_blend_read(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_normals_tag_dirty(), BKE_mesh_runtime_init_data(), BLI_endian_switch_uint32_array(), BLO_read_data_address, BLO_read_list(), BLO_read_pointer_array(), BLO_read_requires_endian_switch(), CustomData_blend_read(), Mesh::dvert, Mesh::edata, Mesh::edit_mesh, Mesh::fdata, Mesh::ldata, Mesh::mat, Mesh::mcol, ME_AUTOSPACE_EVALUATED, Mesh::medge, mesh, Mesh::mface, Mesh::mloop, Mesh::mloopcol, Mesh::mloopuv, Mesh::mpoly, Mesh::mselect, Mesh::mtface, Mesh::mvert, Mesh::pdata, Mesh::runtime, Mesh::texflag, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, Mesh::totvert, Mesh::vdata, and Mesh::vertex_group_names.
|
static |
Definition at line 335 of file mesh.cc.
References BLO_read_id_address, Mesh::id, Mesh::key, ID::lib, Mesh::mat, Mesh::texcomesh, and Mesh::totcol.
|
static |
Definition at line 213 of file mesh.cc.
References Mesh::adt, BKE_animdata_blend_write(), BKE_defbase_blend_write(), BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_pointer_array(), BLO_write_raw(), CD_MASK_MESH, CustomData_blend_write(), CustomData_blend_write_prepare(), Mesh::edata, CustomData_MeshMasks::emask, Mesh::fdata, CustomData_MeshMasks::fmask, Mesh::id, ID_IS_OVERRIDE_LIBRARY, Mesh::ldata, CustomData_MeshMasks::lmask, Mesh::mat, Mesh::medge, mesh, Mesh::mface, Mesh::mloop, Mesh::mpoly, Mesh::mselect, Mesh::mvert, Mesh::pdata, CustomData_MeshMasks::pmask, Mesh::runtime, Mesh::totcol, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, Mesh::totvert, Mesh::vdata, Mesh::vertex_group_names, and CustomData_MeshMasks::vmask.
Definition at line 920 of file mesh.cc.
References Mesh::act_face, BKE_mesh_update_customdata_pointers(), CustomData_free(), Mesh::edata, Mesh::fdata, Mesh::ldata, MEM_SAFE_FREE, mesh, Mesh::mselect, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_clear_geometry(), and mesh_free_data().
Definition at line 93 of file mesh.cc.
References BKE_defgroup_copy_list(), BKE_id_copy_ex(), BKE_mesh_assert_normals_dirty_or_calculated(), BKE_mesh_normals_tag_dirty(), BKE_mesh_runtime_reset_on_copy(), BKE_mesh_update_customdata_pointers(), CD_DUPLICATE, Mesh::cd_flag, CD_MASK_DERIVEDMESH, CD_MASK_MESH, CD_REFERENCE, CustomData_copy(), CustomData_MeshMasks_update(), Mesh_Runtime::deformed_only, Mesh::edata, Mesh::edit_mesh, Mesh::fdata, Key::from, Key::id, Mesh::id, Mesh_Runtime::is_original, Mesh::key, Mesh::ldata, LIB_ID_COPY_CD_REFERENCE, LIB_ID_COPY_SHAPEKEY, LIB_TAG_NO_MAIN, mask(), Mesh::mat, MEM_dupallocN, mesh_tessface_clear_intern(), Mesh::mselect, Mesh::pdata, Mesh::runtime, Mesh_Runtime::subsurf_face_dot_tags, ID::tag, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, Mesh::vdata, and Mesh::vertex_group_names.
Definition at line 971 of file mesh.cc.
References CD_CALLOC, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MPOLY, CD_MVERT, CustomData_add_layer(), CustomData_get_layer(), Mesh::edata, Mesh::fdata, Mesh::ldata, mesh, Mesh::pdata, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and Mesh::vdata.
Referenced by BKE_mesh_new_nomain(), and BKE_mesh_new_nomain_from_template_ex().
Definition at line 745 of file mesh.cc.
References BKE_mesh_add_mface_layers(), BKE_mesh_tessface_clear(), CD_MCOL, CD_MLOOPUV, CD_MTFACE, CD_PROP_BYTE_COLOR, CustomData_number_of_layers(), Mesh::fdata, G, G_DEBUG, Mesh::ldata, Mesh::totface, Mesh::totpoly, and UNLIKELY.
Referenced by mesh_update_linked_customdata().
|
static |
Definition at line 195 of file mesh.cc.
References BKE_LIB_FOREACHID_PROCESS_IDSUPER, data, IDWALK_CB_NEVER_SELF, IDWALK_CB_USER, Mesh::key, Mesh::mat, mesh, Mesh::texcomesh, and Mesh::totcol.
|
static |
Definition at line 205 of file mesh.cc.
References BKE_bpath_foreach_path_fixed_process(), CustomData::external, CustomDataExternal::filepath, and Mesh::ldata.
Definition at line 182 of file mesh.cc.
References BKE_mesh_free_editmesh(), BKE_mesh_runtime_free_data(), BLI_freelistN(), Mesh::mat, MEM_SAFE_FREE, mesh, mesh_clear_geometry(), and Mesh::vertex_group_names.
Referenced by BKE_mesh_eval_delete(), and BKE_mesh_free_data_for_undo().
Definition at line 70 of file mesh.cc.
References BKE_mesh_normals_tag_dirty(), BKE_mesh_runtime_init_data(), BLI_assert, BLI_hash_int(), CustomData_reset(), DNA_struct_default_get, Mesh::edata, Mesh::face_sets_color_seed, Mesh::fdata, Mesh::ldata, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, mesh, Mesh::pdata, PIL_check_seconds_timer_i(), UINT_MAX, and Mesh::vdata.
|
static |
Definition at line 353 of file mesh.cc.
References Freestyle::a, BLO_expand, Mesh::key, Mesh::mat, Mesh::texcomesh, and Mesh::totcol.
Definition at line 948 of file mesh.cc.
References CustomData_free(), CustomData_reset(), Mesh::fdata, Mesh::mcol, mesh, Mesh::mface, Mesh::mtface, and Mesh::totface.
Referenced by BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_tessface_clear(), and mesh_copy_data().
This ensures grouped custom-data (e.g. CD_MLOOPUV and CD_MTFACE, or CD_PROP_BYTE_COLOR and CD_MCOL) have the same relative active/render/clone/mask indices.
NOTE(@campbellbarton): that for undo mesh data we want to skip 'ensure_tess_cd' call since we don't want to store memory for MFace data when its only used for older versions of the mesh.
Definition at line 865 of file mesh.cc.
References CustomData_bmesh_update_active_layers(), Mesh::fdata, Mesh::ldata, and mesh_ensure_tessellation_customdata().
Referenced by BKE_mesh_update_customdata_pointers().
Definition at line 1513 of file mesh.cc.
References MPoly::totloop, and MLoop::v.
Referenced by poly_get_adj_loops_from_vert().
int poly_get_adj_loops_from_vert | ( | const MPoly * | poly, |
const MLoop * | mloop, | ||
uint | vert, | ||
uint | r_adj[2] | ||
) |
Definition at line 1524 of file mesh.cc.
References MPoly::loopstart, ME_POLY_LOOP_NEXT, ME_POLY_LOOP_PREV, and poly_find_loop_from_vert().
|
static |
Definition at line 2016 of file mesh.cc.
References BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_edgehash_ensure_p(), BLI_edgehash_free(), BLI_edgehash_new_ex(), BLI_memarena_alloc(), MLoop::e, MPoly::loopstart, Mesh::medge, MEM_freeN, mesh, Mesh::mloop, Mesh::mpoly, blender::nodes::node_geo_extrude_mesh_cc::new_edge(), POINTER_AS_INT, POINTER_FROM_INT, Mesh::totedge, MPoly::totloop, Mesh::totpoly, MLoop::v, MEdge::v1, and MEdge::v2.
Referenced by BKE_mesh_split_faces().
|
static |
Definition at line 1935 of file mesh.cc.
References BKE_mesh_vertex_normals_ensure(), BKE_mesh_vertex_normals_for_write(), BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_BITMAP_TEST_BOOL, BLI_memarena_alloc(), copy_v3_v3(), MLoopNorSpaceArray::data_type, float(), MLoopNorSpaceArray::lspacearr, MEM_freeN, mesh, MLNOR_SPACE_IS_SINGLE, MLNOR_SPACEARR_LOOP_INDEX, Mesh::mloop, SplitFaceNewVert::new_index, SplitFaceNewVert::next, LinkNode::next, SplitFaceNewVert::orig_index, POINTER_AS_INT, Mesh::totloop, Mesh::totvert, MLoop::v, and SplitFaceNewVert::vnor.
Referenced by BKE_mesh_split_faces().
|
static |
Definition at line 2103 of file mesh.cc.
References BLI_assert, CustomData_copy_data(), Mesh::edata, Mesh::medge, mesh, SplitFaceNewEdge::new_index, SplitFaceNewEdge::next, SplitFaceNewEdge::orig_index, Mesh::totedge, SplitFaceNewEdge::v1, MEdge::v1, SplitFaceNewEdge::v2, and MEdge::v2.
Referenced by BKE_mesh_split_faces().
|
static |
Definition at line 2078 of file mesh.cc.
References BKE_mesh_vertex_normals_are_dirty(), BKE_mesh_vertex_normals_for_write(), BLI_assert, copy_v3_v3(), CustomData_copy_data(), float(), mesh, Mesh::mvert, SplitFaceNewVert::new_index, SplitFaceNewVert::next, SplitFaceNewVert::orig_index, Mesh::totvert, Mesh::vdata, and SplitFaceNewVert::vnor.
Referenced by BKE_mesh_split_faces().
IDTypeInfo IDType_ID_ME |
Definition at line 364 of file mesh.cc.
Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().