Fix #106396: UV stitch crash with hidden faces #106493

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:106396 into main 2023-04-04 12:10:41 +02:00
2 changed files with 6 additions and 3 deletions

View File

@ -974,7 +974,7 @@ UvElementMap *BM_uv_element_map_create(BMesh *bm,
const bool use_seams,
const bool do_islands)
{
/* In uv sync selection, all UVs are visible. */
/* In uv sync selection, all UVs (from unhidden geometry) are visible. */
const bool face_selected = !(scene->toolsettings->uv_flag & UV_SYNC_SELECTION);
BMVert *ev;

View File

@ -1889,9 +1889,12 @@ static StitchState *stitch_init(bContext *C,
counter = 0;
/* Now, on to generate our uv connectivity data */
const bool face_selected = !(ts->uv_flag & UV_SYNC_SELECTION);
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
if (!(ts->uv_flag & UV_SYNC_SELECTION) &&
(BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))) {
if (BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
continue;
}
if (face_selected && !BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
continue;
}