Blender
V3.3
|
#include "bmesh_class.h"
Go to the source code of this file.
Classes | |
struct | BMeshNormalsUpdate_Params |
Definition at line 2239 of file bmesh_mesh_normals.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().
Definition at line 2202 of file bmesh_mesh_normals.c.
References BKE_lnor_space_custom_data_to_normal(), bm, BM_data_layer_add(), BM_ELEM_CD_GET_VOID_P, BM_FACES_OF_MESH, BM_ITER_ELEM, BM_ITER_MESH, BM_lnorspace_update(), BM_LOOPS_OF_FACE, 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().
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 auto-smooth!
Definition at line 409 of file bmesh_mesh_normals.c.
References bm, bm_mesh_edges_sharp_tag(), cosf, M_PI, and NULL.
Referenced by bevel_harden_normals(), BKE_editmesh_lnorspace_update(), and mesh_customdata_custom_splitnormals_add_exec().
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 1920 of file bmesh_mesh_normals.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().
Definition at line 1746 of file bmesh_mesh_normals.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(), and initTransform().
Definition at line 1814 of file bmesh_mesh_normals.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().
Definition at line 1889 of file bmesh_mesh_normals.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_custom_loop_normals(), flip_custom_normals(), and flip_custom_normals_init_data().
Definition at line 1720 of file bmesh_mesh_normals.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().
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 425 of file bmesh_mesh_normals.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_for_loop(), edbm_average_normals_exec(), and normals_split().
void BM_loop_normal_editdata_array_free | ( | struct BMLoopNorEditDataArray * | lnors_ed_arr | ) |
Definition at line 2189 of file bmesh_mesh_normals.c.
References BMLoopNorEditDataArray::lidx_to_lnor_editdata, BMLoopNorEditDataArray::lnor_editdata, MEM_freeN, and MEM_SAFE_FREE.
Referenced by edbm_flip_normals_custom_loop_normals(), edbm_flip_normals_face_winding(), 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, |
bool | do_all_loops_of_vert | ||
) |
Definition at line 2141 of file bmesh_mesh_normals.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_custom_loop_normals(), 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], | ||
bool | use_split_normals, | ||
float | split_angle, | ||
float(*) | r_lnos[3], | ||
struct MLoopNorSpaceArray * | r_lnors_spacearr, | ||
short(*) | clnors_data[2], | ||
int | cd_loop_clnors_offset, | ||
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 1683 of file bmesh_mesh_normals.c.
References BLI_assert, bm, bm_mesh_loops_calc_normals(), bm_mesh_loops_calc_normals_no_autosmooth(), and cosf.
Referenced by BM_lnorspace_err(), BM_lnorspace_rebuild(), BM_lnorspacearr_store(), and mesh_render_data_update_normals().
Definition at line 251 of file bmesh_mesh_normals.c.
References bm, and BM_mesh_normals_update_ex().
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(), mesh_separate_tagged(), modwrap_dependsOnNormals(), SCULPT_dynamic_topology_enable_ex(), and slice_paint_mask().
void BM_mesh_normals_update_ex | ( | BMesh * | bm, |
const struct BMeshNormalsUpdate_Params * | param | ||
) |
BMesh Compute Normals.
Updates the normals of a mesh.
Definition at line 236 of file bmesh_mesh_normals.c.
References BLI_parallel_mempool_settings_defaults(), bm, bm_face_calc_normals_cb(), BM_FACES_OF_MESH, bm_mesh_verts_calc_normals(), BM_OMP_LIMIT, NULL, params, BMesh::totedge, and TaskParallelSettings::use_threading.
Referenced by BKE_editmesh_looptri_and_normals_calc(), BM_mesh_normals_update(), and EDBM_mesh_normals_update_ex().
void BM_mesh_normals_update_with_partial | ( | BMesh * | bm, |
const struct BMPartialUpdate * | bmpinfo | ||
) |
void BM_mesh_normals_update_with_partial_ex | ( | BMesh * | bm, |
const struct BMPartialUpdate * | bmpinfo, | ||
const struct BMeshNormalsUpdate_Params * | param | ||
) |
A version of BM_mesh_normals_update that updates a subset of geometry, used to avoid the overhead of updating everything.
Definition at line 338 of file bmesh_mesh_normals.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().
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 323 of file bmesh_mesh_normals.c.
References bm, and bm_mesh_verts_calc_normals().
Referenced by BKE_editmesh_cache_ensure_vert_normals().