Blender  V2.93
Classes | Macros | Typedefs | Functions | Variables
bmesh_mesh.h File Reference
#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
 

Functions

void BM_mesh_elem_toolflags_ensure (BMesh *bm)
 
void BM_mesh_elem_toolflags_clear (BMesh *bm)
 
BMeshBM_mesh_create (const struct BMAllocTemplate *allocsize, const struct BMeshCreateParams *params)
 
void BM_mesh_free (BMesh *bm)
 BMesh Free Mesh. More...
 
void BM_mesh_data_free (BMesh *bm)
 BMesh Free Mesh Data. More...
 
void BM_mesh_clear (BMesh *bm)
 BMesh Clear Mesh. More...
 
void BM_mesh_normals_update (BMesh *bm)
 BMesh Compute Normals. More...
 
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. More...
 
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], struct 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. More...
 
bool BM_loop_check_cyclic_smooth_fan (BMLoop *l_curr)
 
void BM_lnorspacearr_store (BMesh *bm, float(*r_lnors)[3])
 
void BM_lnorspace_invalidate (BMesh *bm, const bool do_invalidate_all)
 
void BM_lnorspace_rebuild (BMesh *bm, bool preserve_clnor)
 
void BM_lnorspace_update (BMesh *bm)
 
void BM_normals_loops_edges_tag (BMesh *bm, const bool do_edges)
 
void BM_lnorspace_err (BMesh *bm)
 
struct BMLoopNorEditDataArrayBM_loop_normal_editdata_array_init (BMesh *bm, const bool do_all_loops_of_vert)
 
void BM_loop_normal_editdata_array_free (struct BMLoopNorEditDataArray *lnors_ed_arr)
 
bool BM_custom_loop_normals_to_vector_layer (struct BMesh *bm)
 
void BM_custom_loop_normals_from_vector_layer (struct BMesh *bm, bool add_sharp_edges)
 
void BM_edges_sharp_from_angle_set (BMesh *bm, const float split_angle)
 
void bmesh_edit_begin (BMesh *bm, const BMOpTypeFlag type_flag)
 
void bmesh_edit_end (BMesh *bm, const BMOpTypeFlag type_flag)
 BMesh End Edit. More...
 
void BM_mesh_elem_index_ensure_ex (BMesh *bm, const char htype, int elem_offset[4])
 
void BM_mesh_elem_index_ensure (BMesh *bm, const char htype)
 
void BM_mesh_elem_index_validate (BMesh *bm, const char *location, const char *func, const char *msg_a, const char *msg_b)
 
void BM_mesh_toolflags_set (BMesh *bm, bool use_toolflags)
 
bool BM_mesh_elem_table_check (BMesh *bm)
 
void BM_mesh_elem_table_ensure (BMesh *bm, const char htype)
 
void BM_mesh_elem_table_init (BMesh *bm, const char htype)
 
void BM_mesh_elem_table_free (BMesh *bm, const char htype)
 
BLI_INLINE BMVertBM_vert_at_index (BMesh *bm, const int index)
 
BLI_INLINE BMEdgeBM_edge_at_index (BMesh *bm, const int index)
 
BLI_INLINE BMFaceBM_face_at_index (BMesh *bm, const int index)
 
BMVertBM_vert_at_index_find (BMesh *bm, const int index)
 
BMEdgeBM_edge_at_index_find (BMesh *bm, const int index)
 
BMFaceBM_face_at_index_find (BMesh *bm, const int index)
 
BMLoopBM_loop_at_index_find (BMesh *bm, const int index)
 
BMVertBM_vert_at_index_find_or_table (BMesh *bm, const int index)
 
BMEdgeBM_edge_at_index_find_or_table (BMesh *bm, const int index)
 
BMFaceBM_face_at_index_find_or_table (BMesh *bm, const int index)
 
int BM_mesh_elem_count (BMesh *bm, const char htype)
 
void BM_mesh_remap (BMesh *bm, const uint *vert_idx, const uint *edge_idx, const uint *face_idx)
 
void BM_mesh_rebuild (BMesh *bm, const struct BMeshCreateParams *params, struct BLI_mempool *vpool, struct BLI_mempool *epool, struct BLI_mempool *lpool, struct BLI_mempool *fpool)
 
void BM_mesh_vert_coords_get (BMesh *bm, float(*vert_coords)[3])
 
float(* BM_mesh_vert_coords_alloc (BMesh *bm, int *r_vert_len))[3]
 
void BM_mesh_vert_coords_apply (BMesh *bm, const float(*vert_coords)[3])
 
void BM_mesh_vert_coords_apply_with_mat4 (BMesh *bm, const float(*vert_coords)[3], const float mat[4][4])
 

Variables

const BMAllocTemplate bm_mesh_allocsize_default
 
const BMAllocTemplate bm_mesh_chunksize_default
 

Macro Definition Documentation

◆ _VA_BMALLOC_TEMPLATE_FROM_ME_1

#define _VA_BMALLOC_TEMPLATE_FROM_ME_1 (   me)
Value:
{ \
(CHECK_TYPE_INLINE(me, Mesh *), (me)->totvert), (me)->totedge, (me)->totloop, (me)->totpoly, \
}
#define CHECK_TYPE_INLINE(val, type)

Definition at line 151 of file bmesh_mesh.h.

◆ _VA_BMALLOC_TEMPLATE_FROM_ME_2

#define _VA_BMALLOC_TEMPLATE_FROM_ME_2 (   me_a,
  me_b 
)
Value:
{ \
(CHECK_TYPE_INLINE(me_a, Mesh *), \
CHECK_TYPE_INLINE(me_b, Mesh *), \
(me_a)->totvert + (me_b)->totvert), \
(me_a)->totedge + (me_b)->totedge, (me_a)->totloop + (me_b)->totloop, \
(me_a)->totpoly + (me_b)->totpoly, \
}

Definition at line 155 of file bmesh_mesh.h.

◆ BMALLOC_TEMPLATE_FROM_BM

#define BMALLOC_TEMPLATE_FROM_BM (   bm)
Value:
{ \
(CHECK_TYPE_INLINE(bm, BMesh *), (bm)->totvert), (bm)->totedge, (bm)->totloop, (bm)->totface \
}
ATTR_WARN_UNUSED_RESULT BMesh * bm

Definition at line 146 of file bmesh_mesh.h.

◆ BMALLOC_TEMPLATE_FROM_ME

#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 Documentation

◆ BMAllocTemplate

Function Documentation

◆ BM_custom_loop_normals_from_vector_layer()

void BM_custom_loop_normals_from_vector_layer ( struct BMesh bm,
bool  add_sharp_edges 
)

◆ BM_custom_loop_normals_to_vector_layer()

bool BM_custom_loop_normals_to_vector_layer ( BMesh bm)

◆ BM_edge_at_index()

BLI_INLINE BMEdge* BM_edge_at_index ( BMesh bm,
const int  index 
)

◆ BM_edge_at_index_find()

BMEdge* BM_edge_at_index_find ( BMesh bm,
const int  index 
)

◆ BM_edge_at_index_find_or_table()

BMEdge* BM_edge_at_index_find_or_table ( BMesh bm,
const int  index 
)

◆ BM_edges_sharp_from_angle_set()

void BM_edges_sharp_from_angle_set ( BMesh bm,
const float  split_angle 
)

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().

◆ BM_face_at_index()

BLI_INLINE BMFace* BM_face_at_index ( BMesh bm,
const int  index 
)

◆ BM_face_at_index_find()

BMFace* BM_face_at_index_find ( BMesh bm,
const int  index 
)

◆ BM_face_at_index_find_or_table()

BMFace* BM_face_at_index_find_or_table ( BMesh bm,
const int  index 
)

◆ BM_lnorspace_err()

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().

◆ BM_lnorspace_invalidate()

void BM_lnorspace_invalidate ( BMesh bm,
const bool  do_invalidate_all 
)

◆ BM_lnorspace_rebuild()

void BM_lnorspace_rebuild ( BMesh bm,
bool  preserve_clnor 
)

◆ BM_lnorspace_update()

void BM_lnorspace_update ( BMesh bm)

◆ BM_lnorspacearr_store()

void BM_lnorspacearr_store ( BMesh bm,
float(*)  r_lnors[3] 
)

◆ BM_loop_at_index_find()

BMLoop* BM_loop_at_index_find ( BMesh bm,
const int  index 
)

◆ BM_loop_check_cyclic_smooth_fan()

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().

◆ BM_loop_normal_editdata_array_free()

void BM_loop_normal_editdata_array_free ( struct BMLoopNorEditDataArray lnors_ed_arr)

◆ BM_loop_normal_editdata_array_init()

struct BMLoopNorEditDataArray* BM_loop_normal_editdata_array_init ( BMesh bm,
const bool  do_all_loops_of_vert 
)

◆ BM_loops_calc_normal_vcos()

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().

◆ BM_mesh_clear()

void BM_mesh_clear ( BMesh bm)

◆ BM_mesh_create()

BMesh* BM_mesh_create ( const struct BMAllocTemplate allocsize,
const struct BMeshCreateParams params 
)

◆ BM_mesh_data_free()

void BM_mesh_data_free ( BMesh bm)

◆ BM_mesh_elem_count()

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().

◆ BM_mesh_elem_index_ensure()

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().

◆ BM_mesh_elem_index_ensure_ex()

void BM_mesh_elem_index_ensure_ex ( BMesh bm,
const char  htype,
int  elem_offset[4] 
)

◆ BM_mesh_elem_index_validate()

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.

◆ BM_mesh_elem_table_check()

bool BM_mesh_elem_table_check ( BMesh bm)

◆ BM_mesh_elem_table_ensure()

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().

◆ BM_mesh_elem_table_free()

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().

◆ BM_mesh_elem_table_init()

void BM_mesh_elem_table_init ( BMesh bm,
const char  htype 
)

◆ BM_mesh_elem_toolflags_clear()

void BM_mesh_elem_toolflags_clear ( BMesh bm)

◆ BM_mesh_elem_toolflags_ensure()

void BM_mesh_elem_toolflags_ensure ( BMesh bm)

◆ BM_mesh_free()

void BM_mesh_free ( BMesh bm)

◆ BM_mesh_normals_update()

void BM_mesh_normals_update ( BMesh bm)

◆ BM_mesh_rebuild()

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 
)

◆ BM_mesh_remap()

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.

Note
  • Does not mess with indices, just sets elem_index_dirty flag.
  • For verts/edges/faces only (as loops must remain "ordered" and "aligned" on a per-face basis...).
Warning
Be careful if you keep pointers to affected BM elements, or arrays, when using this func!

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().

◆ BM_mesh_toolflags_set()

void BM_mesh_toolflags_set ( BMesh bm,
bool  use_toolflags 
)

◆ BM_mesh_vert_coords_alloc()

float(* BM_mesh_vert_coords_alloc ( BMesh bm,
int *  r_vert_len 
) )[3]

◆ BM_mesh_vert_coords_apply()

void BM_mesh_vert_coords_apply ( BMesh bm,
const float(*)  vert_coords[3] 
)

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().

◆ BM_mesh_vert_coords_apply_with_mat4()

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().

◆ BM_mesh_vert_coords_get()

void BM_mesh_vert_coords_get ( BMesh bm,
float(*)  vert_coords[3] 
)

◆ BM_normals_loops_edges_tag()

void BM_normals_loops_edges_tag ( BMesh bm,
const bool  do_edges 
)

◆ BM_vert_at_index()

BLI_INLINE BMVert* BM_vert_at_index ( BMesh bm,
const int  index 
)

◆ BM_vert_at_index_find()

BMVert* BM_vert_at_index_find ( BMesh bm,
const int  index 
)

◆ BM_vert_at_index_find_or_table()

BMVert* BM_vert_at_index_find_or_table ( BMesh bm,
const int  index 
)

Use lookup table when available, else use slower find functions.

Note
Try to use BM_mesh_elem_table_ensure instead.

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().

◆ BM_verts_calc_normal_vcos()

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().

◆ bmesh_edit_begin()

void bmesh_edit_begin ( BMesh bm,
const BMOpTypeFlag  type_flag 
)

◆ bmesh_edit_end()

void bmesh_edit_end ( BMesh bm,
const BMOpTypeFlag  type_flag 
)

Variable Documentation

◆ bm_mesh_allocsize_default

const BMAllocTemplate bm_mesh_allocsize_default
extern

◆ bm_mesh_chunksize_default

const BMAllocTemplate bm_mesh_chunksize_default
extern

Definition at line 47 of file bmesh_mesh.c.

Referenced by bm_mempool_init_ex(), and CustomData_bmesh_init_pool().