|
Blender
V2.93
|
#include "bmesh_class.h"Go to the source code of this file.
Classes | |
| struct | BMeshCreateParams |
| struct | BMAllocTemplate |
Macros | |
| #define | BMALLOC_TEMPLATE_FROM_BM(bm) |
| #define | _VA_BMALLOC_TEMPLATE_FROM_ME_1(me) |
| #define | _VA_BMALLOC_TEMPLATE_FROM_ME_2(me_a, me_b) |
| #define | BMALLOC_TEMPLATE_FROM_ME(...) VA_NARGS_CALL_OVERLOAD(_VA_BMALLOC_TEMPLATE_FROM_ME_, __VA_ARGS__) |
Typedefs | |
| typedef struct BMAllocTemplate | BMAllocTemplate |
Variables | |
| const BMAllocTemplate | bm_mesh_allocsize_default |
| const BMAllocTemplate | bm_mesh_chunksize_default |
| #define _VA_BMALLOC_TEMPLATE_FROM_ME_1 | ( | me | ) |
Definition at line 151 of file bmesh_mesh.h.
| #define _VA_BMALLOC_TEMPLATE_FROM_ME_2 | ( | me_a, | |
| me_b | |||
| ) |
Definition at line 155 of file bmesh_mesh.h.
| #define BMALLOC_TEMPLATE_FROM_BM | ( | bm | ) |
Definition at line 146 of file bmesh_mesh.h.
| #define BMALLOC_TEMPLATE_FROM_ME | ( | ... | ) | VA_NARGS_CALL_OVERLOAD(_VA_BMALLOC_TEMPLATE_FROM_ME_, __VA_ARGS__) |
Definition at line 163 of file bmesh_mesh.h.
| typedef struct BMAllocTemplate BMAllocTemplate |
| void BM_custom_loop_normals_from_vector_layer | ( | struct BMesh * | bm, |
| bool | add_sharp_edges | ||
| ) |
Definition at line 1940 of file bmesh_mesh.c.
References bm, bm_mesh_loops_custom_normals_set(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, CD_CUSTOMLOOPNORMAL, CD_NORMAL, CustomData_get_offset(), CustomData_has_layer(), BMesh::ldata, BMesh::lnor_spacearr, MEM_callocN, NULL, and BMesh::spacearr_dirty.
Referenced by edbm_connect_vert_pair(), edbm_delete_exec(), edbm_dissolve_edges_exec(), edbm_dissolve_faces_exec(), edbm_dissolve_limited_exec(), edbm_dissolve_verts_exec(), edbm_edge_split_selected_edges(), edbm_edge_split_selected_verts(), edbm_knife_cut_exec(), edbm_merge_exec(), edbm_quads_convert_to_tris_exec(), edbm_remove_doubles_exec(), edbm_rip_invoke(), edbm_split_exec(), edbm_tris_convert_to_quads_exec(), edbm_vert_connect_path_exec(), and mesh_separate_arrays().
| bool BM_custom_loop_normals_to_vector_layer | ( | BMesh * | bm | ) |
Definition at line 1903 of file bmesh_mesh.c.
References BKE_lnor_space_custom_data_to_normal(), bm, BM_data_layer_add(), BM_ELEM_CD_GET_VOID_P, BM_elem_index_get, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_lnorspace_update(), BM_LOOP, BM_LOOPS_OF_FACE, BM_mesh_elem_index_ensure(), CD_CUSTOMLOOPNORMAL, CD_FLAG_TEMPORARY, CD_NORMAL, CustomData_get_offset(), CustomData_has_layer(), CustomData_set_layer_flag(), l, BMesh::ldata, BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, and normal.
Referenced by edbm_connect_vert_pair(), edbm_delete_exec(), edbm_dissolve_edges_exec(), edbm_dissolve_faces_exec(), edbm_dissolve_limited_exec(), edbm_dissolve_verts_exec(), edbm_edge_split_selected_edges(), edbm_edge_split_selected_verts(), edbm_knife_cut_exec(), edbm_merge_exec(), edbm_quads_convert_to_tris_exec(), edbm_remove_doubles_exec(), edbm_rip_invoke(), edbm_split_exec(), edbm_tris_convert_to_quads_exec(), edbm_vert_connect_path_exec(), and mesh_separate_loose().
| BLI_INLINE BMEdge* BM_edge_at_index | ( | BMesh * | bm, |
| const int | index | ||
| ) |
Definition at line 104 of file bmesh_mesh.h.
References BLI_assert, bm, BM_EDGE, BMesh::elem_table_dirty, and BMesh::etable.
Referenced by bm_edgexedge_isect_cb(), bm_edgexvert_isect_cb(), bm_original_edge_get(), cb_bedge_verts_get(), construct_param_handle_subsurfed(), lineart_geometry_object_load(), loopcut_init(), mesh_foreachScreenEdge__mapFunc(), and mesh_foreachScreenEdge_clip_bb_segment__mapFunc().
Definition at line 2381 of file bmesh_mesh.c.
References BLI_mempool_findelem(), bm, and BMesh::epool.
Referenced by BM_edge_at_index_find_or_table(), and ED_view3d_gizmo_mesh_preselect_get_active().
Definition at line 2425 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_edge_at_index_find(), BMesh::elem_table_dirty, BMesh::etable, and NULL.
Referenced by EDBM_edge_find_nearest_ex(), EDBM_elem_from_index_any(), and edbm_select_id_bm_elem_get().
Define sharp edges as needed to mimic 'autosmooth' from angle threshold.
Used when defining an empty custom loop normals data layer, to keep same shading as with autosmooth!
Definition at line 1382 of file bmesh_mesh.c.
References bm, bm_mesh_edges_sharp_tag(), M_PI, and NULL.
Referenced by bevel_harden_normals(), BKE_editmesh_lnorspace_update(), and mesh_customdata_custom_splitnormals_add_exec().
| BLI_INLINE BMFace* BM_face_at_index | ( | BMesh * | bm, |
| const int | index | ||
| ) |
Definition at line 110 of file bmesh_mesh.h.
References BLI_assert, bm, BM_FACE, BMesh::elem_table_dirty, and BMesh::ftable.
Referenced by bm_mesh_calc_uv_islands(), bm_original_face_get(), BM_uv_vert_map_create(), bmo_recalc_face_normals_exec(), construct_param_handle_subsurfed(), EDBM_select_interior_faces(), edbm_select_similar_region_exec(), extract_fdots_nor_finish(), extract_fdots_nor_hq_finish(), lineart_geometry_object_load(), math_layer_info_init(), mesh_foreachScreenFace__mapFunc(), sculpt_face_sets_init_flood_fill(), snap_mesh_polygon(), stitch_init(), uv_select_flush_from_tag_sticky_loc_internal(), and uv_select_linked_multi().
Definition at line 2386 of file bmesh_mesh.c.
References BLI_mempool_findelem(), bm, and BMesh::fpool.
Referenced by BM_face_at_index_find_or_table(), and ED_view3d_gizmo_mesh_preselect_get_active().
Definition at line 2433 of file bmesh_mesh.c.
References bm, BM_FACE, BM_face_at_index_find(), BMesh::elem_table_dirty, BMesh::ftable, and NULL.
Referenced by EDBM_elem_from_index_any(), EDBM_face_find_nearest_ex(), edbm_select_id_bm_elem_get(), and uv_shortest_path_pick_exec().
| void BM_lnorspace_err | ( | BMesh * | bm | ) |
Auxiliary function only used by rebuild to detect if any spaces were not marked as invalid. Reports error if any of the lnor spaces change after rebuilding, meaning that all the possible lnor spaces to be rebuilt were not correctly marked.
Definition at line 1623 of file bmesh_mesh.c.
References BKE_lnor_spacearr_free(), BKE_lnor_spacearr_init(), BLI_assert, bm, BM_loops_calc_normal_vcos(), BM_SPACEARR_DIRTY_ALL, CD_CUSTOMLOOPNORMAL, clear(), compare_ff(), compare_v3v3(), CustomData_get_offset(), float(), BMesh::ldata, BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, M_PI, MEM_callocN, MEM_freeN, MLNOR_SPACEARR_BMLOOP_PTR, NULL, MLoopNorSpace::ref_alpha, MLoopNorSpace::ref_beta, BMesh::spacearr_dirty, BMesh::totloop, MLoopNorSpace::vec_lnor, MLoopNorSpace::vec_ortho, and MLoopNorSpace::vec_ref.
Referenced by BM_lnorspace_rebuild().
| void BM_lnorspace_invalidate | ( | BMesh * | bm, |
| const bool | do_invalidate_all | ||
| ) |
Definition at line 1418 of file bmesh_mesh.c.
References BLI_BITMAP_ENABLE, BLI_BITMAP_NEW, BLI_BITMAP_TEST, bm, BM_ELEM_API_FLAG_ENABLE, BM_elem_flag_test, BM_elem_index_get, BM_ELEM_SELECT, BM_ITER_ELEM, BM_ITER_MESH, BM_LNORSPACE_UPDATE, BM_LOOPS_OF_VERT, BM_mesh_elem_index_ensure(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, BM_VERT, BM_VERTS_OF_MESH, CLEAR_SPACEARRAY_THRESHOLD, l, BMesh::lnor_spacearr, MEM_freeN, BMLoop::next, NULL, BMLoop::prev, BMesh::spacearr_dirty, BMesh::totvert, BMesh::totvertsel, BMLoop::v, and v.
Referenced by EDBM_update_generic(), and initTransform().
| void BM_lnorspace_rebuild | ( | BMesh * | bm, |
| bool | preserve_clnor | ||
| ) |
Definition at line 1486 of file bmesh_mesh.c.
References BKE_lnor_space_custom_data_to_normal(), BKE_lnor_space_custom_normal_to_data(), BKE_lnor_spacearr_clear(), BLI_assert, bm, BM_ELEM_API_FLAG_DISABLE, BM_ELEM_API_FLAG_TEST, BM_ELEM_CD_GET_VOID_P, BM_elem_index_get, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_lnorspace_err(), BM_LNORSPACE_UPDATE, BM_LOOP, BM_loops_calc_normal_vcos(), BM_LOOPS_OF_FACE, BM_mesh_elem_index_ensure(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, CD_CUSTOMLOOPNORMAL, CustomData_get_offset(), float(), l, BMesh::ldata, BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, M_PI, MEM_callocN, MEM_freeN, MEM_mallocN, MEM_SAFE_FREE, NULL, BMesh::spacearr_dirty, and BMesh::totloop.
Referenced by BM_lnorspace_update(), and transformEnd().
| void BM_lnorspace_update | ( | BMesh * | bm | ) |
Definition at line 1565 of file bmesh_mesh.c.
References bm, BM_lnorspace_rebuild(), BM_lnorspacearr_store(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, float(), BMesh::lnor_spacearr, MLoopNorSpaceArray::lspacearr, MEM_callocN, MEM_freeN, NULL, BMesh::spacearr_dirty, and BMesh::totloop.
Referenced by bevel_harden_normals(), BKE_editmesh_lnorspace_update(), BM_custom_loop_normals_to_vector_layer(), edbm_flip_normals_exec(), flip_custom_normals(), and flip_custom_normals_init_data().
Definition at line 1392 of file bmesh_mesh.c.
References BLI_assert, bm, BM_data_layer_add(), BM_loops_calc_normal_vcos(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, CD_CUSTOMLOOPNORMAL, CustomData_get_offset(), CustomData_has_layer(), BMesh::ldata, BMesh::lnor_spacearr, M_PI, NULL, and BMesh::spacearr_dirty.
Referenced by BM_lnorspace_update().
Definition at line 2391 of file bmesh_mesh.c.
References bm, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BMFace::len, len, BMLoop::next, and NULL.
Referenced by uv_shortest_path_pick_exec().
| bool BM_loop_check_cyclic_smooth_fan | ( | BMLoop * | l_curr | ) |
Check whether given loop is part of an unknown-so-far cyclic smooth fan, or not. Needed because cyclic smooth fans have no obvious 'entry point', and yet we need to walk them once, and only once.
Definition at line 636 of file bmesh_mesh.c.
References BLI_assert, BM_elem_flag_enable, BM_elem_flag_test, BM_ELEM_TAG, BM_vert_step_fan_loop(), and BMLoop::e.
Referenced by bm_mesh_loops_calc_normals(), edbm_average_normals_exec(), and normals_split().
| void BM_loop_normal_editdata_array_free | ( | struct BMLoopNorEditDataArray * | lnors_ed_arr | ) |
Definition at line 1892 of file bmesh_mesh.c.
References BMLoopNorEditDataArray::lidx_to_lnor_editdata, BMLoopNorEditDataArray::lnor_editdata, MEM_freeN, and MEM_SAFE_FREE.
Referenced by edbm_flip_normals_exec(), edbm_normals_make_consistent_exec(), edbm_normals_tools_exec(), edbm_smooth_normals_exec(), flip_custom_normals(), freeCustomNormalArray(), normals_split_merge(), and point_normals_free().
| struct BMLoopNorEditDataArray* BM_loop_normal_editdata_array_init | ( | BMesh * | bm, |
| const bool | do_all_loops_of_vert | ||
| ) |
Definition at line 1844 of file bmesh_mesh.c.
References BLI_assert, BLI_BITMAP_NEW, BLI_BITMAP_TEST, bm, BM_data_layer_add(), BM_elem_index_get, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, bm_loop_normal_mark_indiv(), BM_LOOPS_OF_VERT, BM_mesh_elem_index_ensure(), BM_VERTS_OF_MESH, BMLoopNorEditDataArray::cd_custom_normal_offset, CD_CUSTOMLOOPNORMAL, CustomData_get_offset(), CustomData_has_layer(), l, BMesh::ldata, BMLoopNorEditDataArray::lidx_to_lnor_editdata, BMLoopNorEditDataArray::lnor_editdata, loop_normal_editdata_init(), MEM_callocN, MEM_freeN, MEM_mallocN, BMesh::spacearr_dirty, BMesh::totloop, BMLoopNorEditDataArray::totloop, and v.
Referenced by edbm_flip_normals_exec(), edbm_normals_tools_exec(), edbm_smooth_normals_exec(), flip_custom_normals(), flip_custom_normals_init_data(), normals_split_merge(), point_normals_init(), and storeCustomLNorValue().
| void BM_loops_calc_normal_vcos | ( | BMesh * | bm, |
| const float(*) | vcos[3], | ||
| const float(*) | vnos[3], | ||
| const float(*) | fnos[3], | ||
| const bool | use_split_normals, | ||
| const float | split_angle, | ||
| float(*) | r_lnos[3], | ||
| MLoopNorSpaceArray * | r_lnors_spacearr, | ||
| short(*) | clnors_data[2], | ||
| const int | cd_loop_clnors_offset, | ||
| const bool | do_rebuild | ||
| ) |
BMesh Compute Loop Normals from/to external data.
Compute split normals, i.e. vertex normals associated with each poly (hence 'loop normals'). Useful to materialize sharp edges (or non-smooth faces) without actually modifying the geometry (splitting edges).
Definition at line 1346 of file bmesh_mesh.c.
References BLI_assert, bm, bm_mesh_edges_sharp_tag(), bm_mesh_loops_calc_normals(), bm_mesh_loops_calc_normals_no_autosmooth(), and M_PI.
Referenced by BM_lnorspace_err(), BM_lnorspace_rebuild(), BM_lnorspacearr_store(), and mesh_render_data_update_normals().
| void BM_mesh_clear | ( | BMesh * | bm | ) |
Clear all data in bm
Definition at line 281 of file bmesh_mesh.c.
References bm, bm_mempool_init(), bm_mesh_allocsize_default, BM_mesh_data_free(), CustomData_reset(), BMesh::edata, BMesh::ldata, BMesh::pdata, BMesh::toolflag_index, BMesh::totflags, BMesh::use_toolflags, and BMesh::vdata.
Referenced by bpy_bmesh_clear(), and EDBM_mesh_clear().
| BMesh* BM_mesh_create | ( | const struct BMAllocTemplate * | allocsize, |
| const struct BMeshCreateParams * | params | ||
| ) |
| void BM_mesh_data_free | ( | BMesh * | bm | ) |
Frees a BMesh structure.
Definition at line 185 of file bmesh_mesh.c.
References BKE_lnor_spacearr_free(), BLI_freelistN(), BLI_mempool_destroy(), bm, BM_EDGES_OF_MESH, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOPS_OF_FACE, BM_mesh_elem_toolflags_clear(), BM_VERTS_OF_MESH, BMO_error_clear(), CustomData_bmesh_free_block(), CustomData_bmesh_has_free(), CustomData_free(), BMHeader::data, e, BMesh::edata, BMesh::epool, BMesh::etable, BMesh::fpool, BMesh::ftable, BMVert::head, BMLoop::head, BMFace::head, l, BMesh::ldata, BMesh::lnor_spacearr, BMesh::lpool, MEM_freeN, BMesh::pdata, CustomData::pool, BMesh::selected, CustomData::totlayer, v, BMesh::vdata, BMesh::vpool, and BMesh::vtable.
Referenced by BM_mesh_clear(), BM_mesh_free(), EDBM_redo_state_free(), and EDBM_redo_state_restore().
| int BM_mesh_elem_count | ( | BMesh * | bm, |
| const char | htype | ||
| ) |
Return the amount of element of type 'type' in a given bmesh.
Definition at line 2444 of file bmesh_mesh.c.
References BLI_assert, bm, BM_ALL_NOLOOP, BM_EDGE, BM_FACE, BM_VERT, BMesh::totedge, BMesh::totface, and BMesh::totvert.
Referenced by SCULPT_vertex_count_get(), and TEST().
| void BM_mesh_elem_index_ensure | ( | BMesh * | bm, |
| const char | htype | ||
| ) |
Definition at line 2152 of file bmesh_mesh.c.
References bm, BM_mesh_elem_index_ensure_ex(), and NULL.
Referenced by armature_deform_coords_impl(), BKE_bmbvh_new_ex(), BKE_editmesh_cache_ensure_poly_centers(), BKE_editmesh_cache_ensure_poly_normals(), BKE_editmesh_cache_ensure_vert_normals(), BKE_editmesh_loop_tangent_calc(), BKE_mesh_foreach_mapped_edge(), BKE_mesh_foreach_mapped_loop(), BKE_pbvh_node_raycast(), BM_custom_loop_normals_to_vector_layer(), bm_decim_triangulate_begin(), bm_edge_info_average_length_fallback(), BM_lnorspace_invalidate(), BM_lnorspace_rebuild(), BM_loop_normal_editdata_array_init(), bm_loop_normal_mark_indiv(), BM_mesh_calc_path_edge(), BM_mesh_decimate_dissolve_ex(), BM_mesh_edgenet(), bm_mesh_edges_calc_vectors(), bm_mesh_edges_sharp_tag(), BM_mesh_intersect(), bm_mesh_loops_calc_normals(), bm_mesh_loops_calc_normals_no_autosmooth(), BM_mesh_normals_update(), BM_mesh_region_match(), bm_mesh_verts_calc_normals(), BM_uv_element_map_create(), BM_uv_vert_map_create(), BMeshFairingContext::BMeshFairingContext(), bmo_offset_edgeloops_exec(), bmo_smooth_laplacian_vert_exec(), bpy_bmelemseq_index_update(), calc_solidify_normals(), construct_param_handle(), construct_param_handle_subsurfed(), DRW_text_edit_mesh_measure_stats(), ED_mesh_mirrtopo_init(), edbm_face_split_by_edges_exec(), edbm_mod_weighted_strength_exec(), EDBM_preselect_edgering_update_from_edge(), EDBM_preselect_elem_update_from_single(), edbm_select_linked_pick_invoke(), edbm_shortest_path_pick_invoke(), EDBM_unified_findnearest_from_raycast(), EDBM_verts_mirror_cache_begin_ex(), gizmo_preselect_edgering_test_select(), gizmo_preselect_elem_test_select(), knifetool_init_bmbvh(), lattice_deform_coords_impl(), lineart_geometry_object_load(), loopcut_finish(), math_layer_info_init(), mesh_calc_path_region_elem(), mesh_render_data_create(), SCULPT_stroke_get_location(), SCULPT_vertex_random_access_ensure(), snap_mesh_polygon(), snapEditMesh(), solidify_add_thickness(), statvis_calc_distort(), statvis_calc_intersect(), statvis_calc_thickness(), stitch_process_data(), transform_convert_mesh_islands_calc(), uv_find_nearest_edge(), uv_find_nearest_vert(), uv_select_overlap(), uv_set_connectivity_distance(), uv_shortest_path_pick_invoke(), and vgroup_smooth_subset().
| void BM_mesh_elem_index_ensure_ex | ( | BMesh * | bm, |
| const char | htype, | ||
| int | elem_offset[4] | ||
| ) |
Definition at line 2038 of file bmesh_mesh.c.
References BLI_assert, bm, BM_EDGE, BM_EDGES_OF_MESH, BM_elem_index_set, BM_ELEM_INDEX_VALIDATE, BM_FACE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH, BM_LOOP, BM_VERT, BM_VERTS_OF_MESH, BMesh::elem_index_dirty, elem_offset(), BMLoop::next, NULL, BMesh::totedge, BMesh::totface, BMesh::totloop, and BMesh::totvert.
Referenced by BM_mesh_elem_index_ensure(), and EDBM_mesh_elem_index_ensure_multi().
| void BM_mesh_elem_index_validate | ( | BMesh * | bm, |
| const char * | location, | ||
| const char * | func, | ||
| const char * | msg_a, | ||
| const char * | msg_b | ||
| ) |
Array checking/setting macros
Currently vert/edge/loop/face index data is being abused, in a few areas of the code.
To avoid correcting them afterwards, set 'bm->elem_index_dirty' however its possible this flag is set incorrectly which could crash blender.
Code that calls this functions may depend on dirty indices on being set. Keep this function read-only.
Definition at line 2169 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_EDGES_OF_MESH, BM_elem_index_get, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH, BM_VERT, BM_VERTS_OF_MESH, and BMesh::elem_index_dirty.
| bool BM_mesh_elem_table_check | ( | BMesh * | bm | ) |
Definition at line 2242 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_EDGES_OF_MESH, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_VERT, BM_VERTS_OF_MESH, BMesh::elem_table_dirty, BMesh::etable, BMesh::ftable, and BMesh::vtable.
Referenced by BM_mesh_elem_table_ensure(), and EDBM_update_generic().
| void BM_mesh_elem_table_ensure | ( | BMesh * | bm, |
| const char | htype | ||
| ) |
Definition at line 2276 of file bmesh_mesh.c.
References BLI_assert, bm, BM_ALL_NOLOOP, BM_EDGE, BM_EDGES_OF_MESH, BM_FACE, BM_FACES_OF_MESH, BM_iter_as_array(), BM_mesh_elem_table_check(), BM_VERT, BM_VERTS_OF_MESH, BMesh::elem_table_dirty, BMesh::etable, BMesh::etable_tot, BMesh::ftable, BMesh::ftable_tot, MEM_freeN, MEM_mallocN, NULL, BMesh::totedge, BMesh::totface, BMesh::totvert, BMesh::vtable, and BMesh::vtable_tot.
Referenced by bm_mesh_calc_uv_islands(), BM_mesh_elem_table_init(), BM_mesh_intersect(), BM_mesh_intersect_edges(), BM_mesh_remap(), BMeshFairingContext::BMeshFairingContext(), bmo_recalc_face_normals_exec(), bpy_bmelemseq_ensure_lookup_table(), bvhtree_from_editmesh_edges_create_tree(), bvhtree_from_editmesh_verts_create_tree(), construct_param_handle_subsurfed(), draw_select_id_edit_mesh(), ED_mesh_mirror_spatial_table_begin(), ED_mesh_mirrtopo_init(), ED_transverts_create_from_obedit(), ED_vgroup_parray_mirror_assign(), ED_vgroup_parray_mirror_sync(), edbm_face_split_by_edges_exec(), EDBM_select_interior_faces(), edbm_select_similar_region_exec(), EDBM_verts_mirror_cache_begin_ex(), blender::ed::spreadsheet::GeometryDataSource::get_selected_element_indices(), get_vert_def_nr(), give_parvert(), lineart_geometry_object_load(), loopcut_init(), math_layer_info_init(), mesh_foreachScreenEdge(), mesh_foreachScreenEdge_clip_bb_segment(), mesh_foreachScreenFace(), mesh_foreachScreenVert(), mesh_render_data_create(), mesh_symmetry_snap_exec(), multires_unsubdivide_extract_grids(), multires_unsubdivide_prepare_original_bmesh_for_extract(), multires_unsubdivide_single_level(), sculpt_face_set_delete_geometry(), sculpt_face_sets_init_flood_fill(), SCULPT_stroke_get_location(), SCULPT_vertex_random_access_ensure(), snap_mesh_polygon(), snapEditMesh(), stitch_init(), transform_convert_mesh_islands_calc(), uv_select_flush_from_tag_face(), uv_select_flush_from_tag_loop(), uv_select_linked_multi(), uv_select_overlap(), and vgroup_smooth_subset().
| void BM_mesh_elem_table_free | ( | BMesh * | bm, |
| const char | htype | ||
| ) |
Definition at line 2361 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_FACE, BM_VERT, BMesh::etable, BMesh::ftable, MEM_SAFE_FREE, and BMesh::vtable.
Referenced by BM_mesh_elem_table_init().
| void BM_mesh_elem_table_init | ( | BMesh * | bm, |
| const char | htype | ||
| ) |
Definition at line 2352 of file bmesh_mesh.c.
References BLI_assert, bm, BM_ALL_NOLOOP, BM_mesh_elem_table_ensure(), and BM_mesh_elem_table_free().
Referenced by multires_unsubdivide_single_level(), sculpt_face_set_delete_geometry(), and sculpt_face_sets_init_flood_fill().
| void BM_mesh_elem_toolflags_clear | ( | BMesh * | bm | ) |
Definition at line 132 of file bmesh_mesh.c.
References BLI_mempool_destroy(), bm, BMesh::etoolflagpool, BMesh::ftoolflagpool, NULL, and BMesh::vtoolflagpool.
Referenced by BM_mesh_data_free(), and select_linked_delimit_end().
| void BM_mesh_elem_toolflags_ensure | ( | BMesh * | bm | ) |
Definition at line 98 of file bmesh_mesh.c.
References BLI_assert, BLI_mempool_calloc(), BLI_mempool_create(), BLI_MEMPOOL_NOP, bm, BM_EDGES_OF_MESH, BM_FACES_OF_MESH, BM_ITER_MESH, BM_VERTS_OF_MESH, BMesh::etoolflagpool, BMesh::ftoolflagpool, BMVert_OFlag::oflags, BMEdge_OFlag::oflags, BMFace_OFlag::oflags, BMesh::totedge, BMesh::totface, BMesh::totflags, BMesh::totvert, BMesh::use_toolflags, and BMesh::vtoolflagpool.
Referenced by BMO_op_exec(), build_skin(), mesh_separate_tagged(), select_linked_delimit_begin(), and walker_deselect_nth().
| void BM_mesh_free | ( | BMesh * | bm | ) |
Frees a BMesh data and its structure.
Definition at line 307 of file bmesh_mesh.c.
References bm, BM_mesh_data_free(), bpy_bm_generic_invalidate(), MEM_freeN, NULL, and BMesh::py_handle.
Referenced by base_skin(), bc_triangulate_mesh(), BKE_editmesh_free(), BKE_mesh_mirror_apply_mirror_on_axis(), BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(), BKE_mesh_remesh_voxel_fix_poles(), BKE_sculptsession_free(), bpy_bmesh_dealloc(), bpy_bmesh_free(), blender::nodes::create_cube_mesh(), blender::nodes::create_ico_sphere_mesh(), blender::io::alembic::ABCGenericMeshWriter::do_write(), doEdgeSplit(), ED_uvedit_add_simple_uvs(), EDBM_automerge_and_split(), edbm_separate_exec(), mesh_customdatacorrect_free_cb(), mesh_separate_arrays(), mesh_separate_tagged(), modifyMesh(), multires_unsubdivide_extract_grids(), multires_unsubdivide_private_extract_data_free(), multires_unsubdivide_to_basemesh(), paint_mask_slice_exec(), SCULPT_dynamic_topology_disable_ex(), sculpt_face_set_create_exec(), sculpt_face_set_delete_geometry(), sculpt_face_sets_init_flood_fill(), sculpt_face_sets_init_loop(), sculpt_gesture_apply_trim(), sculpt_gesture_trim_normals_update(), TEST(), triangulate_mesh(), and WireframeModifier_do().
| void BM_mesh_normals_update | ( | BMesh * | bm | ) |
BMesh Compute Normals.
Updates the normals of a mesh.
Definition at line 500 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_elem_index_set, BM_FACE, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, bm_mesh_edges_calc_vectors(), BM_mesh_elem_index_ensure(), bm_mesh_verts_calc_normals(), BM_OMP_LIMIT, BM_VERT, BM_VERTS_OF_MESH, BMesh::elem_index_dirty, float(), MEM_freeN, MEM_mallocN, mesh_faces_calc_normals_cb(), BMVert::no, NULL, BMesh::totedge, BMesh::totface, v, and zero_v3().
Referenced by bevel_harden_normals(), BKE_mesh_remesh_voxel_fix_poles(), bmesh_edit_begin(), bmesh_edit_end(), bpy_bmesh_normal_update(), ED_transverts_update_obedit(), EDBM_mesh_normals_update(), lineart_geometry_object_load(), mesh_separate_tagged(), modwrap_dependsOnNormals(), SCULPT_dynamic_topology_enable_ex(), and slice_paint_mask().
| void BM_mesh_rebuild | ( | BMesh * | bm, |
| const struct BMeshCreateParams * | params, | ||
| BLI_mempool * | vpool_dst, | ||
| BLI_mempool * | epool_dst, | ||
| BLI_mempool * | lpool_dst, | ||
| BLI_mempool * | fpool_dst | ||
| ) |
Use new memory pools for this mesh.
Definition at line 2762 of file bmesh_mesh.c.
References BMesh::act_face, BLI_mempool_alloc(), BLI_mempool_calloc(), BLI_mempool_destroy(), bm, BM_EDGE, BM_EDGES_OF_MESH, BM_elem_index_set, BM_FACE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_LOOP, BM_VERT, BM_VERTS_OF_MESH, BMVert::e, BMLoop::e, e, BMesh::elem_table_dirty, BMesh::epool, BMesh::etable, BMesh::etable_tot, BMesh::etoolflagpool, BMLoop::f, BMesh::fpool, BMesh::ftable, BMesh::ftable_tot, BMesh::ftoolflagpool, BMFace::l_first, LISTBASE_FOREACH, BMesh::lpool, MAP_EDGE, MAP_FACE, MAP_VERT, MEM_freeN, MEM_mallocN, BMLoop::next, NULL, params, BMLoop::prev, BMLoop::radial_next, BMLoop::radial_prev, REMAP_EDGE, REMAP_FACE, REMAP_LOOP, REMAP_VERT, BMesh::selected, SWAP, BMesh::totedge, BMesh::totface, BMesh::totloop, BMesh::totvert, BMLoop::v, v, BMesh::vpool, BMesh::vtable, BMesh::vtable_tot, and BMesh::vtoolflagpool.
Referenced by BM_mesh_toolflags_set().
| void BM_mesh_remap | ( | BMesh * | bm, |
| const uint * | vert_idx, | ||
| const uint * | edge_idx, | ||
| const uint * | face_idx | ||
| ) |
Remaps the vertices, edges and/or faces of the bmesh as indicated by vert/edge/face_idx arrays (xxx_idx[org_index] = new_index).
A NULL array means no changes.
Definition at line 2476 of file bmesh_mesh.c.
References BMesh::act_face, BLI_assert, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_ptr_new_ex(), bm, BM_EDGE, BM_EDGES_OF_MESH, BM_ELEM_CD_GET_VOID_P, BM_FACE, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, BM_LOOPS_OF_FACE, BM_mesh_elem_table_ensure(), BM_VERT, BM_VERTS_OF_MESH, CD_BM_ELEM_PYPTR, CustomData_get_offset(), BMVert::e, BMLoop::e, BMesh::edata, BMEditSelection::ele, BMesh::elem_index_dirty, BMesh::elem_table_dirty, BMesh::etable, BMLoop::f, ListBase::first, BMesh::ftable, BMEditSelection::htype, MEM_freeN, MEM_mallocN, BMDiskLink::next, BMEditSelection::next, NULL, BMesh::pdata, BMDiskLink::prev, BMesh::selected, BMesh::totedge, BMesh::totface, BMesh::totvert, BMLoop::v, BMEdge::v1, BMEdge::v1_disk_link, BMEdge::v2, BMEdge::v2_disk_link, BMesh::vdata, and BMesh::vtable.
Referenced by BM_log_mesh_elems_reorder(), and sort_bmelem_flag().
| void BM_mesh_toolflags_set | ( | BMesh * | bm, |
| bool | use_toolflags | ||
| ) |
Re-allocates mesh data with/without toolflags.
Definition at line 3016 of file bmesh_mesh.c.
References BLI_mempool_destroy(), bm, bm_mempool_init_ex(), BM_mesh_rebuild(), BMALLOC_TEMPLATE_FROM_BM, BMesh::etoolflagpool, BMesh::ftoolflagpool, NULL, BMesh::use_toolflags, and BMesh::vtoolflagpool.
Referenced by sculpt_symmetrize_exec().
Definition at line 3066 of file bmesh_mesh.c.
References bm, BM_mesh_vert_coords_get(), float(), MEM_mallocN, and BMesh::totvert.
Referenced by BKE_editmesh_vert_coords_alloc_orco().
Definition at line 3074 of file bmesh_mesh.c.
References bm, BM_ITER_MESH_INDEX, BM_VERTS_OF_MESH, BMVert::co, copy_v3_v3(), and v.
Referenced by ED_object_data_xform_restore().
| void BM_mesh_vert_coords_apply_with_mat4 | ( | BMesh * | bm, |
| const float(*) | vert_coords[3], | ||
| const float | mat[4][4] | ||
| ) |
Definition at line 3084 of file bmesh_mesh.c.
References bm, BM_ITER_MESH_INDEX, BM_VERTS_OF_MESH, BMVert::co, mul_v3_m4v3(), and v.
Referenced by ED_object_data_xform_by_mat4().
Definition at line 3056 of file bmesh_mesh.c.
References bm, BM_ITER_MESH_INDEX, BM_VERTS_OF_MESH, BMVert::co, copy_v3_v3(), and v.
Referenced by BM_mesh_vert_coords_alloc(), and ED_object_data_xform_create_ex().
| void BM_normals_loops_edges_tag | ( | BMesh * | bm, |
| const bool | do_edges | ||
| ) |
Definition at line 1582 of file bmesh_mesh.c.
References bm, BM_EDGE, BM_edge_loop_pair(), BM_EDGES_OF_MESH, BM_elem_flag_disable, BM_elem_flag_enable, BM_elem_flag_test, BM_elem_index_set, BM_ELEM_SMOOTH, BM_ELEM_TAG, BM_FACE, BM_FACE_FIRST_LOOP, BM_FACES_OF_MESH, BM_ITER_MESH_INDEX, BM_LOOP, e, BMesh::elem_index_dirty, l_b, BMLoop::next, and BMLoop::v.
Referenced by edbm_average_normals_exec(), normals_merge(), and normals_split().
| BLI_INLINE BMVert* BM_vert_at_index | ( | BMesh * | bm, |
| const int | index | ||
| ) |
Definition at line 98 of file bmesh_mesh.h.
References BLI_assert, bm, BM_VERT, BMesh::elem_table_dirty, and BMesh::vtable.
Referenced by bm_edgexvert_isect_cb(), bm_original_vert_get(), bm_vertxvert_isect_cb(), BMeshFairingContext::BMeshFairingContext(), bvhtree_from_editmesh_verts_create_tree(), cb_bvert_co_get(), cb_bvert_no_copy(), createTransEditVerts(), createTransMeshSkin(), ED_mesh_mirror_get_vert(), EDBM_verts_mirror_cache_begin_ex(), editbmesh_get_x_mirror_vert_spatial(), editmesh_verts_spherecast(), extract_tan_ex(), get_vert_def_nr(), give_parvert(), lineart_geometry_object_load(), mesh_foreachScreenVert__mapFunc(), mesh_symmetry_snap_exec(), multires_unsubdivide_extract_grids(), multires_unsubdivide_prepare_original_bmesh_for_extract(), BMeshFairingContext::other_vertex_index_from_loop(), SCULPT_vertex_co_get(), SCULPT_vertex_is_boundary(), SCULPT_vertex_mask_get(), sculpt_vertex_neighbors_get_bmesh(), SCULPT_vertex_normal_get(), SCULPT_vertex_visible_get(), SCULPT_vertex_visible_set(), set_mapped_co(), unsubdivide_init_elem_ids(), and vgroup_smooth_subset().
Definition at line 2376 of file bmesh_mesh.c.
References BLI_mempool_findelem(), bm, and BMesh::vpool.
Referenced by BM_vert_at_index_find_or_table(), and ED_view3d_gizmo_mesh_preselect_get_active().
Use lookup table when available, else use slower find functions.
Definition at line 2417 of file bmesh_mesh.c.
References bm, BM_VERT, BM_vert_at_index_find(), BMesh::elem_table_dirty, NULL, and BMesh::vtable.
Referenced by EDBM_elem_from_index_any(), edbm_select_id_bm_elem_get(), and EDBM_vert_find_nearest_ex().
| void BM_verts_calc_normal_vcos | ( | BMesh * | bm, |
| const float(*) | fnos[3], | ||
| const float(*) | vcos[3], | ||
| float(*) | vnos[3] | ||
| ) |
BMesh Compute Normals from/to external data.
Computes the vertex normals of a mesh into vnos, using given vertex coordinates (vcos) and polygon normals (fnos).
Definition at line 538 of file bmesh_mesh.c.
References bm, bm_mesh_edges_calc_vectors(), bm_mesh_verts_calc_normals(), float(), MEM_freeN, MEM_mallocN, and BMesh::totedge.
Referenced by BKE_editmesh_cache_ensure_vert_normals().
| void bmesh_edit_begin | ( | BMesh * | bm, |
| const BMOpTypeFlag | type_flag | ||
| ) |
| void bmesh_edit_end | ( | BMesh * | bm, |
| const BMOpTypeFlag | type_flag | ||
| ) |
BMesh End Edit.
Definition at line 1998 of file bmesh_mesh.c.
References BLI_listbase_clear(), bm, BM_mesh_normals_update(), BM_mesh_select_mode_flush(), BM_SPACEARR_DIRTY_ALL, BMO_OPTYPE_FLAG_INVALIDATE_CLNOR_ALL, BMO_OPTYPE_FLAG_NORMALS_CALC, BMO_OPTYPE_FLAG_SELECT_FLUSH, BMO_OPTYPE_FLAG_SELECT_VALIDATE, BMO_OPTYPE_FLAG_UNTAN_MULTIRES, CD_MDISPS, CustomData_has_layer(), BMesh::ldata, BMesh::selected, and BMesh::spacearr_dirty.
Referenced by BMO_op_exec(), build_skin(), and mesh_customdatacorrect_free_cb().
|
extern |
Definition at line 46 of file bmesh_mesh.c.
Referenced by bc_triangulate_mesh(), BM_mesh_clear(), BM_mesh_copy_init_customdata(), BM_mesh_copy_init_customdata_all_layers(), BM_mesh_copy_init_customdata_from_mesh(), bpy_bm_new(), build_skin(), ED_uvedit_add_simple_uvs(), edbm_separate_exec(), mesh_customdatacorrect_init_container_generic(), mesh_separate_tagged(), sculpt_undo_bmesh_enable(), and TEST().
|
extern |
Definition at line 47 of file bmesh_mesh.c.
Referenced by bm_mempool_init_ex(), and CustomData_bmesh_init_pool().