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:
authorJoseph Eagar <joeedh@gmail.com>2022-05-15 11:44:09 +0300
committerJoseph Eagar <joeedh@gmail.com>2022-05-15 11:44:09 +0300
commitb54abd7ede6ab1089f8733b1e35a290b7ad2f169 (patch)
tree14c3ccd13ad9573df19eda54ff12e0e2aa014ed0 /source/blender/bmesh/intern
parentf9751889df35c81501c60abd1af98252d80ea3fc (diff)
Fix T80174: Dyntopo not initializing face set values correctly
BMLog was zeroing face sets when creating new faces, which is not valid. They're now set to 1.
Diffstat (limited to 'source/blender/bmesh/intern')
-rw-r--r--source/blender/bmesh/intern/bmesh_log.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c
index a398f14b312..a55eb74285d 100644
--- a/source/blender/bmesh/intern/bmesh_log.c
+++ b/source/blender/bmesh/intern/bmesh_log.c
@@ -288,6 +288,8 @@ static void bm_log_verts_restore(BMesh *bm, BMLog *log, GHash *verts)
static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces)
{
GHashIterator gh_iter;
+ const int cd_face_sets = CustomData_get_offset(&bm->pdata, CD_SCULPT_FACE_SETS);
+
GHASH_ITER (gh_iter, faces) {
void *key = BLI_ghashIterator_getKey(&gh_iter);
BMLogFace *lf = BLI_ghashIterator_getValue(&gh_iter);
@@ -301,6 +303,11 @@ static void bm_log_faces_restore(BMesh *bm, BMLog *log, GHash *faces)
f = BM_face_create_verts(bm, v, 3, NULL, BM_CREATE_NOP, true);
f->head.hflag = lf->hflag;
bm_log_face_id_set(log, f, POINTER_AS_UINT(key));
+
+ /* Ensure face sets have valid values. Fixes T80174. */
+ if (cd_face_sets != -1) {
+ BM_ELEM_CD_SET_INT(f, cd_face_sets, 1);
+ }
}
}