Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/bmesh/tools/bmesh_bisect_plane.c')
-rw-r--r--source/blender/bmesh/tools/bmesh_bisect_plane.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/bmesh/tools/bmesh_bisect_plane.c b/source/blender/bmesh/tools/bmesh_bisect_plane.c
index 6aeb26435ac..7001cfa4061 100644
--- a/source/blender/bmesh/tools/bmesh_bisect_plane.c
+++ b/source/blender/bmesh/tools/bmesh_bisect_plane.c
@@ -139,9 +139,14 @@ static void bm_face_bisect_verts(BMesh *bm, BMFace *f, const float plane[4], con
BMLoop *l_new;
if (LIKELY(STACK_SIZE(vert_split_arr) == 2)) {
+ BMLoop *l_a, *l_b;
+
+ l_a = BM_face_vert_share_loop(f, vert_split_arr[0]);
+ l_b = BM_face_vert_share_loop(f, vert_split_arr[1]);
+
/* common case, just cut the face once */
l_new = NULL;
- BM_face_split(bm, f, vert_split_arr[0], vert_split_arr[1], &l_new, NULL, true);
+ BM_face_split(bm, f, l_a, l_b, &l_new, NULL, true);
if (l_new) {
if (oflag_center) {
BMO_elem_flag_enable(bm, l_new->e, oflag_center);
@@ -254,9 +259,9 @@ static void bm_face_bisect_verts(BMesh *bm, BMFace *f, const float plane[4], con
/* in fact this simple test is good enough,
* test if the loops are adjacent */
- if (found && (l_a->next != l_b && l_a->prev != l_b)) {
+ if (found && !BM_loop_is_adjacent(l_a, l_b)) {
BMFace *f_tmp;
- f_tmp = BM_face_split(bm, face_split_arr[j], l_a->v, l_b->v, NULL, NULL, true);
+ f_tmp = BM_face_split(bm, face_split_arr[j], l_a, l_b, NULL, NULL, true);
if (f_tmp) {
if (f_tmp != face_split_arr[j]) {
STACK_PUSH(face_split_arr, f_tmp);