|
Blender V5.0
|
Go to the source code of this file.
Classes | |
| struct | BMeshNormalsUpdate_Params |
| void BM_custom_loop_normals_from_vector_layer | ( | BMesh * | bm, |
| bool | add_sharp_edges ) |
Definition at line 2367 of file bmesh_mesh_normals.cc.
References bm, bm_mesh_loops_custom_normals_set(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, CD_NORMAL, CD_PROP_INT16_2D, CustomData_get_offset(), CustomData_get_offset_named(), and MEM_callocN().
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_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 2328 of file bmesh_mesh_normals.cc.
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_FLAG_TEMPORARY, CD_NORMAL, CD_PROP_INT16_2D, CustomData_get_offset(), CustomData_get_offset_named(), CustomData_has_layer(), CustomData_has_layer_named(), CustomData_set_layer_flag(), and l.
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_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 auto-smooth from angle threshold.
Used when defining an empty custom loop normals data layer, to keep same shading as with auto-smooth!
Definition at line 401 of file bmesh_mesh_normals.cc.
References bm, bm_mesh_edges_sharp_tag(), cosf, and M_PI.
| 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 1967 of file bmesh_mesh_normals.cc.
References BKE_lnor_spacearr_free(), BKE_lnor_spacearr_init(), BLI_assert, bm, BM_loops_calc_normal_vcos(), BM_SPACEARR_DIRTY_ALL, CD_PROP_INT16_2D, clear(), compare_ff(), compare_v3v3(), CustomData_get_offset_named(), i, MLoopNorSpaceArray::lspacearr, MEM_callocN(), MEM_freeN(), MLNOR_SPACEARR_BMLOOP_PTR, MLoopNorSpace::ref_alpha, MLoopNorSpace::ref_beta, MLoopNorSpace::vec_lnor, MLoopNorSpace::vec_ortho, and MLoopNorSpace::vec_ref.
Referenced by BM_lnorspace_rebuild().
| void BM_lnorspace_invalidate | ( | BMesh * | bm, |
| bool | do_invalidate_all ) |
Definition at line 1742 of file bmesh_mesh_normals.cc.
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, MEM_freeN(), BMLoop::v, and v.
Referenced by EDBM_update(), and blender::ed::transform::initTransform().
| void BM_lnorspace_rebuild | ( | BMesh * | bm, |
| bool | preserve_clnor ) |
Definition at line 1812 of file bmesh_mesh_normals.cc.
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_PROP_INT16_2D, CustomData_get_offset_named(), and l.
Referenced by BM_lnorspace_update(), and blender::ed::transform::transformEnd().
| void BM_lnorspace_update | ( | BMesh * | bm | ) |
Definition at line 1940 of file bmesh_mesh_normals.cc.
References bm, bm_lnorspace_ensure_from_free_normals(), BM_lnorspace_rebuild(), BM_SPACEARR_DIRTY, BM_SPACEARR_DIRTY_ALL, and MEM_callocN().
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().
| void BM_lnorspacearr_store | ( | BMesh * | bm, |
| blender::MutableSpan< blender::float3 > | r_lnors ) |
References bm.
| 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 417 of file bmesh_mesh_normals.cc.
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 | ( | BMLoopNorEditDataArray * | lnors_ed_arr | ) |
Definition at line 2315 of file bmesh_mesh_normals.cc.
References BMLoopNorEditDataArray::lidx_to_lnor_editdata, BMLoopNorEditDataArray::lnor_editdata, MEM_freeN(), and MEM_SAFE_FREE.
Referenced by edbm_fill_grid_split_join_finish(), 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(), blender::ed::transform::freeCustomNormalArray(), normals_split_merge(), and point_normals_free().
| BMLoopNorEditDataArray * BM_loop_normal_editdata_array_init | ( | BMesh * | bm, |
| bool | do_all_loops_of_vert ) |
Definition at line 2309 of file bmesh_mesh_normals.cc.
References bm, and BM_loop_normal_editdata_array_init_with_htype().
Referenced by edbm_flip_normals_custom_loop_normals(), edbm_normals_tools_exec(), edbm_smooth_normals_exec(), normals_split_merge(), point_normals_init(), and blender::ed::transform::storeCustomLNorValue().
| BMLoopNorEditDataArray * BM_loop_normal_editdata_array_init_with_htype | ( | BMesh * | bm, |
| bool | do_all_loops_of_vert, | ||
| char | htype_override ) |
Initialize loop data based on a type, overriding the BMesh::selectmode of bm. This can be useful if a single types selection is preferred, instead of using mixed modes and the selection history.
Definition at line 2243 of file bmesh_mesh_normals.cc.
References BLI_assert, BLI_BITMAP_NEW, BLI_BITMAP_TEST, bm, BM_data_layer_ensure_named(), BM_EDGE, BM_elem_index_get, BM_FACE, BM_ITER_ELEM, BM_ITER_MESH, BM_LOOP, bm_loop_normal_mark_edges(), bm_loop_normal_mark_faces(), bm_loop_normal_mark_indiv(), bm_loop_normal_mark_verts(), BM_LOOPS_OF_VERT, BM_mesh_elem_index_ensure(), BM_VERT, BM_VERTS_OF_MESH, BMLoopNorEditDataArray::cd_custom_normal_offset, CD_PROP_INT16_2D, CustomData_get_offset_named(), ELEM, l, BMLoopNorEditDataArray::lidx_to_lnor_editdata, BMLoopNorEditDataArray::lnor_editdata, loop_normal_editdata_init(), MEM_calloc_arrayN(), MEM_callocN(), MEM_freeN(), MEM_malloc_arrayN(), BMLoopNorEditDataArray::totloop, and v.
Referenced by BM_loop_normal_editdata_array_init(), flip_custom_normals(), and flip_custom_normals_init_data().
| void BM_loops_calc_normal_vcos | ( | BMesh * | bm, |
| blender::Span< blender::float3 > | vcos, | ||
| blender::Span< blender::float3 > | vnos, | ||
| blender::Span< blender::float3 > | fnos, | ||
| bool | use_split_normals, | ||
| blender::MutableSpan< blender::float3 > | r_lnos, | ||
| MLoopNorSpaceArray * | r_lnors_spacearr, | ||
| short(*) | clnors_data[2], | ||
| int | cd_loop_clnors_offset, | ||
| bool | do_rebuild ) |
| void BM_mesh_normals_update | ( | BMesh * | bm | ) |
Definition at line 261 of file bmesh_mesh_normals.cc.
References bm, BM_mesh_normals_update_ex(), and params.
Referenced by bevel_harden_normals(), BKE_mesh_remesh_voxel_fix_poles(), bmesh_edit_begin(), bmesh_edit_end(), blender::ed::sculpt_paint::undo::bmesh_restore_generic(), bpy_bmesh_normal_update(), ED_transverts_update_obedit(), blender::ed::sculpt_paint::dyntopo::enable_ex(), ensure_non_lazy_normals(), mesh_separate_tagged(), and slice_paint_mask().
| void BM_mesh_normals_update_ex | ( | BMesh * | bm, |
| const BMeshNormalsUpdate_Params * | param ) |
BMesh Compute Normals.
Updates the normals of a mesh.
Definition at line 246 of file bmesh_mesh_normals.cc.
References BLI_parallel_mempool_settings_defaults(), bm, bm_face_calc_normals_cb(), BM_FACES_OF_MESH, bm_mesh_verts_calc_normals(), BM_THREAD_LIMIT, params, and TaskParallelSettings::use_threading.
Referenced by BKE_editmesh_looptris_and_normals_calc(), BM_mesh_normals_update(), and EDBM_mesh_normals_update_ex().
| void BM_mesh_normals_update_with_partial | ( | BMesh * | bm, |
| const BMPartialUpdate * | bmpinfo ) |
Definition at line 302 of file bmesh_mesh_normals.cc.
References bm, BM_mesh_normals_update_with_partial_ex(), and params.
| void BM_mesh_normals_update_with_partial_ex | ( | BMesh * | bm, |
| const BMPartialUpdate * | bmpinfo, | ||
| const 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 274 of file bmesh_mesh_normals.cc.
References BLI_assert, BMPartialUpdate_Params::do_normals, BMPartialUpdate::faces, Vector< T, InlineBufferCapacity, Allocator >::index_range(), Vector< T, InlineBufferCapacity, Allocator >::is_empty(), blender::threading::parallel_for(), BMPartialUpdate::params, params, UNLIKELY, and BMPartialUpdate::verts.
Referenced by BKE_editmesh_looptris_and_normals_calc_with_partial(), BM_mesh_normals_update_with_partial(), and blender::ed::transform::mesh_partial_update().
| void BM_normals_loops_edges_tag | ( | BMesh * | bm, |
| bool | do_edges ) |
Definition at line 330 of file bmesh_mesh_normals.cc.
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, 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, |
| blender::Span< blender::float3 > | fnos, | ||
| blender::Span< blender::float3 > | vcos, | ||
| blender::MutableSpan< blender::float3 > | vnos ) |