diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2020-07-24 16:58:34 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2020-07-24 16:58:34 +0300 |
commit | e18cf6f99801ee63fc045bf82b2fe8a002fae1de (patch) | |
tree | 4b7e9fbb73a43bafd96ab2d4a77c4c33b0bbb76d /source/blender/bmesh/tools/bmesh_boolean.cc | |
parent | 50b7025ebfdc04adca83c5f5b42c3cc10fdc1b94 (diff) |
Interpolate face loop data from example faces.
This makes for a reasonable first pass at getting OK UV maps.
Diffstat (limited to 'source/blender/bmesh/tools/bmesh_boolean.cc')
-rw-r--r-- | source/blender/bmesh/tools/bmesh_boolean.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/bmesh/tools/bmesh_boolean.cc b/source/blender/bmesh/tools/bmesh_boolean.cc index 85f86ac4a82..ab264e21b12 100644 --- a/source/blender/bmesh/tools/bmesh_boolean.cc +++ b/source/blender/bmesh/tools/bmesh_boolean.cc @@ -211,6 +211,7 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, Mesh &m_out) else { int orig = face.orig; BMFace *orig_face; + /* There should always be an orig face, but just being extra careful here. */ if (orig != NO_INDEX) { orig_face = old_bmfs[orig]; } @@ -234,6 +235,15 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, Mesh &m_out) BMFace *bmf = BM_face_create( bm, face_bmverts.data(), face_bmedges.data(), flen, orig_face, BM_CREATE_NOP); BM_elem_flag_enable(bmf, KEEP_FLAG); + /* Now do interpolation of loop data (e.g., UVs) using the example face. */ + if (orig_face != NULL) { + BMIter liter; + BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf)); + while (l != NULL) { + BM_loop_interp_from_face(bm, l, orig_face, true, true); + l = static_cast<BMLoop *>(BM_iter_step(&liter)); + } + } any_change = true; } } |