diff options
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 719336f7351..f52ec5f568f 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1525,6 +1525,7 @@ static void sculpt_update_object( ss->multires = mmd; ss->totvert = me_eval->totvert; ss->totpoly = me_eval->totpoly; + ss->totfaces = me->totpoly; ss->mvert = NULL; ss->mpoly = NULL; ss->mloop = NULL; @@ -1532,25 +1533,26 @@ static void sculpt_update_object( else { ss->totvert = me->totvert; ss->totpoly = me->totpoly; + ss->totfaces = me->totpoly; ss->mvert = me->mvert; ss->mpoly = me->mpoly; ss->mloop = me->mloop; ss->multires = NULL; ss->vmask = CustomData_get_layer(&me->vdata, CD_PAINT_MASK); + } - /* Sculpt Face Sets. */ - if (!CustomData_has_layer(&me->pdata, CD_SCULPT_FACE_SETS)) { - ss->face_sets = CustomData_add_layer( - &me->pdata, CD_SCULPT_FACE_SETS, CD_CALLOC, NULL, me->totpoly); - for (int i = 0; i < me->totpoly; i++) { - ss->face_sets[i] = 1; - } - - /* Set the default face set color if the datalayer did not exist. */ - me->face_sets_color_default = 1; + /* Sculpt Face Sets. */ + if (!CustomData_has_layer(&me->pdata, CD_SCULPT_FACE_SETS)) { + ss->face_sets = CustomData_add_layer( + &me->pdata, CD_SCULPT_FACE_SETS, CD_CALLOC, NULL, me->totpoly); + for (int i = 0; i < me->totpoly; i++) { + ss->face_sets[i] = 1; } - ss->face_sets = CustomData_get_layer(&me->pdata, CD_SCULPT_FACE_SETS); + + /* Set the default face set color if the datalayer did not exist. */ + me->face_sets_color_default = 1; } + ss->face_sets = CustomData_get_layer(&me->pdata, CD_SCULPT_FACE_SETS); ss->subdiv_ccg = me_eval->runtime.subdiv_ccg; @@ -1558,6 +1560,9 @@ static void sculpt_update_object( BLI_assert(pbvh == ss->pbvh); UNUSED_VARS_NDEBUG(pbvh); + BKE_pbvh_subdiv_cgg_set(ss->pbvh, ss->subdiv_ccg); + BKE_pbvh_face_sets_set(ss->pbvh, ss->face_sets); + BKE_pbvh_face_sets_color_set(ss->pbvh, me->face_sets_color_seed, me->face_sets_color_default); if (need_pmap && ob->type == OB_MESH && !ss->pmap) { |