|
Blender
V2.93
|
#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_linklist.h"#include "BLI_math.h"#include "BLI_memarena.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BLT_translation.h"#include "BKE_anim_data.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_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 | CD_LAYERS_FREE(id) |
| #define | MAT_NR_REMAP(n) |
Typedefs | |
| typedef struct SplitFaceNewVert | SplitFaceNewVert |
| typedef struct SplitFaceNewEdge | SplitFaceNewEdge |
Variables | |
| IDTypeInfo | IDType_ID_ME |
| #define CD_LAYERS_FREE | ( | id | ) |
| #define MAT_NR_REMAP | ( | n | ) |
| typedef struct SplitFaceNewEdge SplitFaceNewEdge |
| typedef struct SplitFaceNewVert SplitFaceNewVert |
| anonymous enum |
Definition at line 849 of file mesh.c.
References BKE_id_new(), and ID_ME.
Referenced by BKE_mesh_from_nurbs_displist(), BKE_mesh_new_from_object_to_bmain(), BKE_object_obdata_add_from_type(), BKE_pointcloud_to_mesh(), Freestyle::BlenderStrokeRenderer::NewMesh(), object_convert_exec(), blender::io::alembic::AbcSubDReader::readObjectData(), blender::io::alembic::AbcPointsReader::readObjectData(), blender::io::alembic::AbcMeshReader::readObjectData(), and MeshImporter::write_geometry().
Definition at line 1283 of file mesh.c.
References BKE_modifiers_test_object(), BKE_object_materials_test(), Object::data, Mesh::id, id_us_min(), id_us_plus(), multires_force_sculpt_rebuild(), NULL, OB_MESH, and Object::type.
Referenced by MeshImporter::create_mesh_object().
Definition at line 1055 of file mesh.c.
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, NULL, and Object::runtime.
Referenced by BKE_object_boundbox_get(), BKE_object_minmax(), raycastMesh(), snapMesh(), and voxel_size_edit_invoke().
| void BKE_mesh_calc_normals_split | ( | Mesh * | mesh | ) |
Definition at line 1865 of file mesh.c.
References BKE_mesh_calc_normals_split_ex(), mesh, and NULL.
Referenced by GeometryExporter::create_normals(), displaceModifier_do(), editbmesh_calc_modifier_final_normals(), blender::io::alembic::get_loop_normals(), Freestyle::BlenderFileLoader::insertShapeNode(), mesh_calc_modifier_final_normals(), mesh_calc_tri_tessface(), modifyMesh(), and triangulate_mesh().
| void BKE_mesh_calc_normals_split_ex | ( | Mesh * | mesh, |
| MLoopNorSpaceArray * | r_lnors_spacearr | ||
| ) |
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 1797 of file mesh.c.
References BKE_mesh_calc_normals_poly(), BKE_mesh_normals_loop_split(), CD_CALLOC, CD_CUSTOMLOOPNORMAL, Mesh_Runtime::cd_dirty_vert, CD_FLAG_TEMPORARY, CD_MASK_NORMAL, CD_NORMAL, CustomData_add_layer(), CustomData_get_layer(), CustomData_has_layer(), CustomData_set_layer_flag(), Mesh::flag, float(), Mesh::ldata, M_PI, ME_AUTOSMOOTH, Mesh::medge, MEM_freeN, MEM_malloc_arrayN, mesh, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, Mesh::runtime, Mesh::smoothresh, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_mesh_calc_normals_split(), and BKE_mesh_split_faces().
| bool BKE_mesh_clear_facemap_customdata | ( | struct Mesh * | me | ) |
Definition at line 732 of file mesh.c.
References BMEditMesh::bm, bm, BM_data_layer_free(), CD_FACEMAP, CustomData_free_layers(), CustomData_has_layer(), Mesh::edit_mesh, NULL, BMesh::pdata, and Mesh::totpoly.
| void BKE_mesh_clear_geometry | ( | Mesh * | mesh | ) |
Definition at line 827 of file mesh.c.
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 598 of file mesh.c.
References Freestyle::c, cmpcode_to_str(), customdata_compare(), Mesh::ldata, NULL, Mesh::totedge, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Definition at line 995 of file mesh.c.
References BKE_id_copy_ex(), Mesh::id, LIB_ID_COPY_CD_REFERENCE, LIB_ID_COPY_LOCALIZE, NULL, and result.
Referenced by BKE_crazyspace_build_sculpt(), BKE_multires_create_mesh(), BKE_sculpt_get_first_deform_matrices(), canvas_copyMesh(), cloth_make_rest_mesh(), MeshComponent::copy(), create_orco_mesh(), deformVerts(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_Modifier_apply(), dynamicPaint_paintMesh(), editbmesh_calc_modifiers(), MeshComponent::ensure_owns_direct_data(), MeshComponent::get_for_write(), mesh_calc_modifiers(), object_convert_exec(), quadriflow_start_job(), RE_bake_normal_world_to_tangent(), RE_bake_pixels_populate_from_objects(), and remesh_symmetry_bisect().
Definition at line 905 of file mesh.c.
References copy_v3_v3(), Mesh::editflag, Mesh::face_sets_color_default, Mesh::face_sets_color_seed, Mesh::flag, Mesh::loc, Mesh::mat, MEM_dupallocN, MEM_freeN, NULL, Mesh::remesh_mode, Mesh::remesh_voxel_adaptivity, Mesh::remesh_voxel_size, Mesh::size, Mesh::smoothresh, Mesh::symmetry, Mesh::texflag, and Mesh::totcol.
Referenced by BKE_mesh_from_bmesh_for_eval_nomain(), BKE_mesh_from_bmesh_nomain(), and BKE_mesh_new_nomain_from_template_ex().
| void BKE_mesh_count_selected_items | ( | const Mesh * | mesh, |
| int | r_count[3] | ||
| ) |
Definition at line 1725 of file mesh.c.
References BMEditMesh::bm, bm, Mesh::edit_mesh, mesh, BMesh::totedgesel, BMesh::totfacesel, and BMesh::totvertsel.
| void BKE_mesh_do_versions_cd_flag_init | ( | Mesh * | mesh | ) |
Definition at line 1572 of file mesh.c.
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 | ||
| ) |
| bool BKE_mesh_ensure_facemap_customdata | ( | struct Mesh * | me | ) |
Definition at line 713 of file mesh.c.
References BMEditMesh::bm, bm, BM_data_layer_add(), CD_DEFAULT, CD_FACEMAP, CustomData_add_layer(), CustomData_has_layer(), Mesh::edit_mesh, NULL, BMesh::pdata, and Mesh::totpoly.
| void BKE_mesh_ensure_skin_customdata | ( | Mesh * | me | ) |
Definition at line 681 of file mesh.c.
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, NULL, Mesh::totvert, v, and BMesh::vdata.
Referenced by BKE_object_copy_modifier(), ED_object_modifier_add(), mesh_customdata_skin_add_exec(), and skin_root_mark_exec().
| void BKE_mesh_eval_delete | ( | struct Mesh * | mesh_eval | ) |
Definition at line 986 of file mesh.c.
References BKE_libblock_free_data(), BKE_mesh_free_data(), Mesh::edit_mesh, Mesh::id, MEM_freeN, and NULL.
Referenced by BKE_object_free_derived_caches(), and object_force_modifier_update_for_bind().
Definition at line 2146 of file mesh.c.
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, NULL, Mesh::runtime, Mesh::size, and Mesh::texflag.
Referenced by blender::deg::DepsgraphNodeBuilder::build_object_data_geometry_datablock().
| void BKE_mesh_free_data | ( | Mesh * | me | ) |
Free (or release) any data used by this mesh (does not free the mesh itself).
Definition at line 796 of file mesh.c.
References Mesh::id, and mesh_free_data().
Referenced by BKE_mesh_eval_delete(), and undomesh_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 1045 of file mesh.c.
References BKE_id_new_nomain(), BKE_mesh_copy_settings(), bm, BM_mesh_bm_to_me_for_eval(), ID_ME, mesh, and NULL.
| Mesh* BKE_mesh_from_bmesh_nomain | ( | BMesh * | bm, |
| const struct BMeshToMeshParams * | params, | ||
| const Mesh * | me_settings | ||
| ) |
Definition at line 1034 of file mesh.c.
References BKE_id_new_nomain(), BKE_mesh_copy_settings(), BLI_assert, bm, BM_mesh_bm_to_me(), ID_ME, mesh, NULL, and params.
Definition at line 1271 of file mesh.c.
References Object::data, NULL, OB_MESH, and Object::type.
Referenced by BKE_sculpt_ensure_orig_mesh_data(), build_pbvh_from_ccg(), createTransEdge(), createTransEditVerts(), 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_vpaint_color_transform(), 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_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_set(), vertex_color_smooth(), vertex_paint_from_weight(), vertex_paint_use_fast_update_check(), 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().
| bool BKE_mesh_has_custom_loop_normals | ( | Mesh * | me | ) |
Definition at line 786 of file mesh.c.
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] | ||
| ) |
Sets each output array element to the edge index if it is a real edge, or -1.
Definition at line 1461 of file mesh.c.
References e, MLoop::e, Mesh::medge, mesh, Mesh::mloop, MLoopTri::tri, and MLoop::v.
| void BKE_mesh_material_index_clear | ( | Mesh * | me | ) |
Definition at line 1347 of file mesh.c.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_clear_id().
| void BKE_mesh_material_index_remove | ( | Mesh * | me, |
| short | index | ||
| ) |
Definition at line 1307 of file mesh.c.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by material_data_index_remove_id().
| bool BKE_mesh_material_index_used | ( | Mesh * | me, |
| short | index | ||
| ) |
Definition at line 1326 of file mesh.c.
References MPoly::mat_nr, MFace::mat_nr, Mesh::mface, and Mesh::mpoly.
Referenced by BKE_object_material_slot_used().
| void BKE_mesh_material_remap | ( | Mesh * | me, |
| const unsigned int * | remap, | ||
| unsigned int | remap_len | ||
| ) |
Definition at line 1362 of file mesh.c.
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 1474 of file mesh.c.
References MVert::co, minmax_v3v3_v3(), Mesh::mvert, and Mesh::totvert.
| int BKE_mesh_mselect_active_get | ( | Mesh * | me, |
| int | type | ||
| ) |
Return The index of the active element.
Definition at line 1693 of file mesh.c.
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().
| void BKE_mesh_mselect_active_set | ( | Mesh * | me, |
| int | index, | ||
| int | type | ||
| ) |
Definition at line 1705 of file mesh.c.
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().
| void BKE_mesh_mselect_clear | ( | Mesh * | me | ) |
Definition at line 1608 of file mesh.c.
References MEM_freeN, Mesh::mselect, NULL, and Mesh::totselect.
Referenced by paintvert_deselect_all_visible(), and SCULPT_dynamic_topology_enable_ex().
| int BKE_mesh_mselect_find | ( | Mesh * | me, |
| int | index, | ||
| int | type | ||
| ) |
Return the index within me->mselect, or -1
Definition at line 1677 of file mesh.c.
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().
| void BKE_mesh_mselect_validate | ( | Mesh * | me | ) |
Definition at line 1617 of file mesh.c.
References BLI_assert, 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, NULL, 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 877 of file mesh.c.
References BKE_idtype_idcode_to_name(), BKE_libblock_alloc(), BKE_libblock_init_empty(), BKE_mesh_update_customdata_pointers(), CD_NUMTYPES, copy_vn_i(), Mesh::fdata, Mesh::id, ID_ME, Mesh::ldata, LIB_ID_CREATE_LOCALIZE, mesh, mesh_ensure_cdlayers_primary(), NULL, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totvert, and CustomData::typemap.
Referenced by BKE_mesh_new_nomain_from_curve_displist(), blender::nodes::create_circle_mesh(), blender::nodes::create_component_points(), blender::nodes::create_cylinder_or_cone_mesh(), create_empty_mesh(), blender::nodes::create_grid_mesh(), blender::nodes::create_line_mesh(), blender::nodes::create_uv_sphere_mesh(), get_quick_mesh(), hair_create_input_mesh(), blender::nodes::join_mesh_topology_and_builtin_attributes(), blender::bke::join_mesh_topology_and_builtin_attributes(), 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 975 of file mesh.c.
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 932 of file mesh.c.
References BKE_id_new_nomain(), BKE_mesh_copy_settings(), BKE_mesh_update_customdata_pointers(), CD_CALLOC, Mesh::cd_flag, CustomData_copy(), Mesh::fdata, ID_ME, Mesh::ldata, mask(), MEM_dupallocN, mesh_ensure_cdlayers_primary(), mesh_tessface_clear_intern(), Mesh::mselect, NULL, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_mesh_new_nomain_from_template().
Definition at line 1162 of file mesh.c.
References Freestyle::a, MVert::co, copy_v3_v3(), float(), MEM_calloc_arrayN, min_ii(), Mesh::mvert, Mesh::texcomesh, and Mesh::totvert.
Referenced by get_orco_coords(), MOD_deform_mesh_eval_get(), and psys_thread_context_init_distribute().
Definition at line 1179 of file mesh.c.
References Freestyle::a, BKE_mesh_texspace_get(), invert(), madd_v3_v3v3v3(), size(), and Mesh::texcomesh.
Referenced by add_orco_mesh(), distribute_children_exec(), distribute_from_verts_exec(), extract_tan_ex(), psys_face_mat(), psys_mat_hair_to_orco(), and psys_thread_context_init_distribute().
| void BKE_mesh_smooth_flag_set | ( | Mesh * | me, |
| const bool | use_smooth | ||
| ) |
Definition at line 1392 of file mesh.c.
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().
| void BKE_mesh_split_faces | ( | Mesh * | mesh, |
| bool | free_loop_normals | ||
| ) |
Definition at line 2073 of file mesh.c.
References BKE_lnor_spacearr_free(), 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::ldata, MLoopNorSpaceArray::mem, mesh, NULL, 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, and Mesh::totvert.
Referenced by bake_mesh_new_from_object().
| void BKE_mesh_tessface_calc | ( | Mesh * | mesh | ) |
Definition at line 1544 of file mesh.c.
References BKE_mesh_tessface_calc_ex(), BKE_mesh_update_customdata_pointers(), Mesh::fdata, Mesh::ldata, mesh, Mesh::mvert, Mesh::totface, Mesh::totloop, and Mesh::totpoly.
Referenced by BKE_mesh_tessface_ensure().
| void BKE_mesh_tessface_clear | ( | Mesh * | mesh | ) |
Definition at line 1567 of file mesh.c.
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(), ED_vpaint_color_transform(), editbmesh_calc_modifier_final_normals(), mesh_calc_modifier_final_normals(), mesh_ensure_tessellation_customdata(), mesh_init_origspace(), vertex_color_set(), and vertex_color_smooth().
| void BKE_mesh_tessface_ensure | ( | Mesh * | mesh | ) |
Definition at line 1560 of file mesh.c.
References BKE_mesh_tessface_calc(), mesh, Mesh::totface, and Mesh::totpoly.
Referenced by bc_get_mesh_copy(), deformVerts(), blender::io::alembic::ABCHairWriter::do_write(), editbmesh_calc_modifier_final_normals(), mesh_calc_modifier_final_normals(), modifyMesh(), particle_batch_cache_ensure_pos_and_seg(), particle_batch_cache_ensure_procedural_strand_data(), particle_intersect_mesh(), particle_system_update(), PE_mirror_x(), psys_thread_context_init_distribute(), and remap_hair_emitter().
| void BKE_mesh_texspace_calc | ( | Mesh * | me | ) |
Definition at line 1079 of file mesh.c.
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_from_nurbs_displist(), and BKE_mesh_texspace_ensure().
Definition at line 1150 of file mesh.c.
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().
| void BKE_mesh_texspace_ensure | ( | Mesh * | me | ) |
Definition at line 1116 of file mesh.c.
References BKE_mesh_texspace_calc(), ME_AUTOSPACE, ME_AUTOSPACE_EVALUATED, and Mesh::texflag.
Referenced by BKE_mesh_texspace_get(), BKE_mesh_texspace_get_reference(), and psys_get_texture().
Definition at line 1123 of file mesh.c.
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, |
| short ** | r_texflag, | ||
| float ** | r_loc, | ||
| float ** | r_size | ||
| ) |
Definition at line 1135 of file mesh.c.
References BKE_mesh_texspace_ensure(), Mesh::loc, NULL, Mesh::size, and Mesh::texflag.
Referenced by BKE_object_obdata_texspace_get(), drw_call_calc_orco(), eevee_volume_object_mesh_init(), 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 1019 of file mesh.c.
References BKE_mesh_to_bmesh_ex(), 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 1007 of file mesh.c.
References bm, BM_mesh_bm_from_me(), BM_mesh_create(), and BMALLOC_TEMPLATE_FROM_ME.
Referenced by BKE_mesh_to_bmesh().
Definition at line 1485 of file mesh.c.
References BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, CD_NORMAL, MVert::co, copy_m3_m4(), CustomData_duplicate_referenced_layer(), KeyBlock::data, ListBase::first, float(), Mesh::key, Mesh::ldata, mul_m3_v3(), mul_m4_v3(), KeyBlock::next, normalize_m3(), KeyBlock::totelem, Mesh::totloop, and Mesh::totvert.
Referenced by apply_objects_internal(), and blender::nodes::transform_mesh().
Definition at line 1522 of file mesh.c.
References add_v3_v3(), BKE_mesh_update_customdata_pointers(), Key::block, CD_MVERT, MVert::co, CustomData_duplicate_referenced_layer(), KeyBlock::data, ListBase::first, Mesh::key, Mesh::mvert, KeyBlock::next, KeyBlock::totelem, and Mesh::totvert.
Referenced by blender::nodes::geo_node_mesh_primitive_cone_exec(), object_origin_set_exec(), and blender::nodes::transform_mesh().
| void BKE_mesh_update_customdata_pointers | ( | Mesh * | me, |
| const bool | do_ensure_tess_cd | ||
| ) |
Definition at line 766 of file mesh.c.
References CD_MCOL, CD_MDEFORMVERT, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MLOOPCOL, CD_MLOOPUV, CD_MPOLY, CD_MTFACE, CD_MVERT, CustomData_get_layer(), Mesh::dvert, Mesh::fdata, Mesh::ldata, Mesh::mcol, Mesh::medge, mesh_update_linked_customdata(), Mesh::mface, Mesh::mloop, Mesh::mloopcol, Mesh::mloopuv, Mesh::mpoly, Mesh::mtface, and Mesh::mvert.
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_texture_add(), Freestyle::BlenderStrokeRenderer::GenerateStrokeMesh(), 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 1745 of file mesh.c.
References BKE_mesh_vert_coords_get(), float(), MEM_mallocN, mesh, and Mesh::totvert.
Definition at line 1755 of file mesh.c.
References Mesh_Runtime::cd_dirty_vert, CD_MASK_NORMAL, CD_MVERT, copy_v3_v3(), CustomData_duplicate_referenced_layer(), mesh, Mesh::mvert, Mesh::runtime, and Mesh::totvert.
Referenced by BKE_mesh_create_derived_for_modifier(), BKE_mesh_wrapper_ensure_mdata(), 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 1766 of file mesh.c.
References Mesh_Runtime::cd_dirty_vert, CD_MASK_NORMAL, CD_MVERT, CustomData_duplicate_referenced_layer(), mesh, mul_v3_m4v3(), Mesh::mvert, Mesh::runtime, and Mesh::totvert.
Referenced by ED_object_data_xform_by_mat4().
Definition at line 1737 of file mesh.c.
References copy_v3_v3(), mesh, Mesh::mvert, and Mesh::totvert.
Referenced by BKE_mesh_vert_coords_alloc().
| void BKE_mesh_vert_normals_apply | ( | Mesh * | mesh, |
| const short(*) | vert_normals[3] | ||
| ) |
Definition at line 1779 of file mesh.c.
References Mesh_Runtime::cd_dirty_vert, CD_MASK_NORMAL, CD_MVERT, copy_v3_v3_short(), CustomData_duplicate_referenced_layer(), mesh, Mesh::mvert, Mesh::runtime, and Mesh::totvert.
|
static |
Definition at line 386 of file mesh.c.
References 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 |
Definition at line 418 of file mesh.c.
References MLoopCol::a, abs(), MLoopCol::b, BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_lookup(), BLI_edgehash_new_ex(), CD_MDEFORMVERT, CD_MEDGE, CD_MLOOP, CD_MLOOPCOL, CD_MLOOPUV, CD_MPOLY, CD_MVERT, BMVert::co, CustomDataLayer::data, MDeformWeight::def_nr, MDeformVert::dw, ELEM, fabsf, MLoopCol::g, i1, CustomData::layers, len_squared_v2v2(), len_squared_v3v3(), MPoly::loopstart, 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, NULL, MLoopCol::r, 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().
|
static |
Definition at line 266 of file mesh.c.
References Mesh::adt, BKE_animdata_blend_read_data(), BKE_defvert_blend_read(), BKE_mesh_runtime_reset(), BLI_endian_switch_uint32_array(), BLO_read_data_address, BLO_read_pointer_array(), BLO_read_requires_endian_switch(), CustomData_blend_read(), Mesh::dvert, 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, NULL, Mesh::texflag, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, and Mesh::totvert.
|
static |
Definition at line 315 of file mesh.c.
References BLO_read_id_address, Mesh::id, Mesh::key, ID::lib, Mesh::mat, Mesh::texcomesh, and Mesh::totcol.
|
static |
Definition at line 173 of file mesh.c.
References Mesh::adt, ARRAY_SIZE, BKE_animdata_blend_write(), BKE_id_blend_write(), BLO_write_id_struct, BLO_write_is_undo(), BLO_write_pointer_array(), BLO_write_raw(), CD_LAYERS_FREE, CD_MASK_MESH, CD_TEMP_CHUNK_SIZE, CustomData_blend_write(), CustomData_blend_write_prepare(), 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, NULL, CustomData_MeshMasks::pmask, Mesh::runtime, Mesh::totcol, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, Mesh::totvert, ID::us, and CustomData_MeshMasks::vmask.
|
static |
Definition at line 801 of file mesh.c.
References Mesh::act_face, BKE_mesh_update_customdata_pointers(), CustomData_free(), Mesh::edit_mesh, Mesh::fdata, Mesh::ldata, MEM_SAFE_FREE, mesh, Mesh::mselect, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, Mesh::totselect, and Mesh::totvert.
Referenced by BKE_mesh_clear_geometry(), and mesh_free_data().
Definition at line 95 of file mesh.c.
References BKE_id_copy_ex(), BKE_mesh_runtime_reset_on_copy(), BKE_mesh_update_customdata_pointers(), CD_DUPLICATE, CD_MASK_DERIVEDMESH, CD_MASK_MESH, CD_REFERENCE, CustomData_copy(), CustomData_MeshMasks_update(), Mesh_Runtime::deformed_only, 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, NULL, Mesh::runtime, ID::tag, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
|
static |
Definition at line 857 of file mesh.c.
References CD_CALLOC, CD_MEDGE, CD_MFACE, CD_MLOOP, CD_MPOLY, CD_MVERT, CustomData_add_layer(), CustomData_get_layer(), Mesh::fdata, Mesh::ldata, mesh, NULL, Mesh::totedge, Mesh::totface, Mesh::totloop, Mesh::totpoly, and Mesh::totvert.
Referenced by BKE_mesh_new_nomain(), and BKE_mesh_new_nomain_from_template_ex().
|
static |
Definition at line 641 of file mesh.c.
References BKE_mesh_tessface_clear(), CD_MCOL, CD_MLOOPCOL, CD_MLOOPUV, CD_MTFACE, CustomData_from_bmeshpoly(), 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 163 of file mesh.c.
References BKE_LIB_FOREACHID_PROCESS, data, IDWALK_CB_NEVER_SELF, IDWALK_CB_USER, Mesh::key, Mesh::mat, mesh, Mesh::texcomesh, and Mesh::totcol.
|
static |
Definition at line 154 of file mesh.c.
References BKE_mesh_runtime_clear_cache(), Mesh::mat, MEM_SAFE_FREE, mesh, and mesh_clear_geometry().
Referenced by BKE_mesh_free_data().
|
static |
Definition at line 76 of file mesh.c.
References BKE_mesh_runtime_reset(), BLI_assert, BLI_hash_int(), CustomData_reset(), DNA_struct_default_get, Mesh::face_sets_color_seed, Mesh::fdata, Mesh::ldata, MEMCMP_STRUCT_AFTER_IS_ZERO, MEMCPY_STRUCT_AFTER, mesh, PIL_check_seconds_timer_i(), and UINT_MAX.
|
static |
Definition at line 333 of file mesh.c.
References Freestyle::a, BLO_expand, Mesh::key, Mesh::mat, Mesh::texcomesh, and Mesh::totcol.
|
static |
Definition at line 834 of file mesh.c.
References CustomData_free(), CustomData_reset(), Mesh::fdata, Mesh::mcol, mesh, Mesh::mface, Mesh::mtface, NULL, and Mesh::totface.
Referenced by BKE_mesh_new_nomain_from_template_ex(), BKE_mesh_tessface_clear(), and mesh_copy_data().
|
static |
Definition at line 757 of file mesh.c.
References CustomData_bmesh_update_active_layers(), Mesh::fdata, Mesh::ldata, and mesh_ensure_tessellation_customdata().
Referenced by BKE_mesh_update_customdata_pointers().
Find the index of the loop in 'poly' which references vertex, returns -1 if not found
Definition at line 1410 of file mesh.c.
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, | ||
| unsigned int | vert, | ||
| unsigned int | r_adj[2] | ||
| ) |
Fill r_adj with the loop indices in poly adjacent to the vertex. Returns the index of the loop matching vertex, or -1 if the vertex is not in poly
Definition at line 1426 of file mesh.c.
References MPoly::loopstart, ME_POLY_LOOP_NEXT, ME_POLY_LOOP_PREV, and poly_find_loop_from_vert().
|
static |
Definition at line 1968 of file mesh.c.
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, SplitFaceNewEdge::new_index, SplitFaceNewEdge::next, NULL, SplitFaceNewEdge::orig_index, POINTER_AS_INT, POINTER_FROM_INT, Mesh::totedge, MPoly::totloop, Mesh::totpoly, MLoop::v, SplitFaceNewEdge::v1, MEdge::v1, SplitFaceNewEdge::v2, and MEdge::v2.
Referenced by BKE_mesh_split_faces().
|
static |
Definition at line 1889 of file mesh.c.
References BLI_assert, BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, BLI_BITMAP_TEST_BOOL, BLI_memarena_alloc(), MLoopNorSpaceArray::data_type, MLoopNorSpaceArray::lspacearr, MEM_freeN, mesh, MLNOR_SPACE_IS_SINGLE, MLNOR_SPACEARR_LOOP_INDEX, Mesh::mloop, Mesh::mvert, SplitFaceNewVert::new_index, SplitFaceNewVert::next, LinkNode::next, normal_float_to_short_v3(), NULL, 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 2049 of file mesh.c.
References BLI_assert, CustomData_copy_data(), 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 2029 of file mesh.c.
References BLI_assert, CustomData_copy_data(), mesh, Mesh::mvert, SplitFaceNewVert::new_index, SplitFaceNewVert::next, MVert::no, normal_float_to_short_v3(), SplitFaceNewVert::orig_index, Mesh::totvert, and SplitFaceNewVert::vnor.
Referenced by BKE_mesh_split_faces().
| int test_index_face | ( | MFace * | mface, |
| CustomData * | fdata, | ||
| int | mfindex, | ||
| int | nr | ||
| ) |
Definition at line 1203 of file mesh.c.
References CustomData_swap_corners(), SWAP, MFace::v1, MFace::v2, MFace::v3, and MFace::v4.
Referenced by BKE_mesh_tessface_calc_ex(), cutEdges(), and explodeMesh().
| IDTypeInfo IDType_ID_ME |
Definition at line 344 of file mesh.c.
Referenced by blender::bke::tests::test_lattice_deform_free(), and blender::bke::tests::test_lattice_deform_init().