diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-03-02 06:09:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-03-02 06:09:27 +0300 |
commit | 4913e47aa0107cbe1daf06e8020a60916ea883a3 (patch) | |
tree | 29cf5e0671027f74296d866cff0df66267bd09c8 /source/blender/bmesh | |
parent | b7016e69b3fff44d623f8413f9ebd4f7216a9b9b (diff) | |
parent | 7e4c23e4d7a3a27a49930824c822b679416724f6 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.c | 16 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mesh.h | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index d178b48ab60..9a927bd4701 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -597,9 +597,11 @@ static void bm_mesh_edges_sharp_tag( bm->elem_index_dirty &= ~BM_EDGE; } -/* Check whether gievn 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. */ -static bool bm_mesh_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. + */ +bool BM_loop_check_cyclic_smooth_fan(BMLoop *l_curr) { BMLoop *lfan_pivot_next = l_curr; BMEdge *e_next = l_curr->e; @@ -665,7 +667,7 @@ static void bm_mesh_loops_calc_normals( r_lnors_spacearr = &_lnors_spacearr; } if (r_lnors_spacearr) { - BKE_lnor_spacearr_init(r_lnors_spacearr, bm->totloop); + BKE_lnor_spacearr_init(r_lnors_spacearr, bm->totloop, MLNOR_SPACEARR_BMLOOP_PTR); edge_vectors = BLI_stack_new(sizeof(float[3]), __func__); } @@ -700,7 +702,7 @@ static void bm_mesh_loops_calc_normals( * However, this would complicate the code, add more memory usage, and BM_vert_step_fan_loop() * is quite cheap in term of CPU cycles, so really think it's not worth it. */ if (BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && - (BM_elem_flag_test(l_curr, BM_ELEM_TAG) || !bm_mesh_loop_check_cyclic_smooth_fan(l_curr))) + (BM_elem_flag_test(l_curr, BM_ELEM_TAG) || !BM_loop_check_cyclic_smooth_fan(l_curr))) { } else if (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && @@ -734,7 +736,7 @@ static void bm_mesh_loops_calc_normals( BKE_lnor_space_define(lnor_space, r_lnos[l_curr_index], vec_curr, vec_prev, NULL); /* We know there is only one loop in this space, no need to create a linklist in this case... */ - BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, l_curr_index, false); + BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, l_curr_index, l_curr, true); if (has_clnors) { short (*clnor)[2] = clnors_data ? &clnors_data[l_curr_index] : @@ -853,7 +855,7 @@ static void bm_mesh_loops_calc_normals( if (r_lnors_spacearr) { /* Assign current lnor space to current 'vertex' loop. */ - BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, lfan_pivot_index, true); + BKE_lnor_space_add_loop(r_lnors_spacearr, lnor_space, lfan_pivot_index, lfan_pivot, false); if (e_next != e_org) { /* We store here all edges-normalized vectors processed. */ BLI_stack_push(edge_vectors, vec_next); diff --git a/source/blender/bmesh/intern/bmesh_mesh.h b/source/blender/bmesh/intern/bmesh_mesh.h index 8326e82af00..10f024423aa 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.h +++ b/source/blender/bmesh/intern/bmesh_mesh.h @@ -52,6 +52,9 @@ void BM_loops_calc_normal_vcos( 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); +bool BM_loop_check_cyclic_smooth_fan(BMLoop *l_curr); + + void BM_edges_sharp_from_angle_set(BMesh *bm, const float split_angle); void bmesh_edit_begin(BMesh *bm, const BMOpTypeFlag type_flag); |