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:
authorCampbell Barton <ideasman42@gmail.com>2016-03-14 06:15:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-03-14 06:21:16 +0300
commit66043cc6c1911c9b8af971fb26916ed8363549ce (patch)
tree978851064d7a7dc167e7deb511814a33afceb5d6 /source/blender/bmesh/intern/bmesh_polygon.c
parent0024768f8838cbbdd00fcbe181b771a5523a521f (diff)
Fix T47788: Symmetrize flips multi-res data
Symmetrize was unusable with multi-res data, add an option for the bmesh operator not to flip the multi-res depth.
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_polygon.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_polygon.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c
index 40f6078dc0b..62b29e61d08 100644
--- a/source/blender/bmesh/intern/bmesh_polygon.c
+++ b/source/blender/bmesh/intern/bmesh_polygon.c
@@ -702,12 +702,20 @@ void BM_face_calc_center_mean_vcos(
* Reverses the winding of a face.
* \note This updates the calculated normal.
*/
-void BM_face_normal_flip(BMesh *bm, BMFace *f)
+void BM_face_normal_flip_ex(
+ BMesh *bm, BMFace *f,
+ const int cd_loop_mdisp_offset, const bool use_loop_mdisp_flip)
{
- bmesh_loop_reverse(bm, f);
+ bmesh_loop_reverse(bm, f, cd_loop_mdisp_offset, use_loop_mdisp_flip);
negate_v3(f->no);
}
+void BM_face_normal_flip(BMesh *bm, BMFace *f)
+{
+ const int cd_loop_mdisp_offset = CustomData_get_offset(&bm->ldata, CD_MDISPS);
+ BM_face_normal_flip_ex(bm, f, cd_loop_mdisp_offset, true);
+}
+
/* detects if two line segments cross each other (intersects).
* note, there could be more winding cases then there needs to be. */
static bool line_crosses_v2f(const float v1[2], const float v2[2], const float v3[2], const float v4[2])