Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 8,122 Lines • ▼ Show 20 Lines | CustomData_copy( | ||||
| &unode->geom_ldata, &me->ldata, CD_MASK_MESH.lmask, CD_DUPLICATE, unode->geom_totloop); | &unode->geom_ldata, &me->ldata, CD_MASK_MESH.lmask, CD_DUPLICATE, unode->geom_totloop); | ||||
| CustomData_copy( | CustomData_copy( | ||||
| &unode->geom_pdata, &me->pdata, CD_MASK_MESH.pmask, CD_DUPLICATE, unode->geom_totpoly); | &unode->geom_pdata, &me->pdata, CD_MASK_MESH.pmask, CD_DUPLICATE, unode->geom_totpoly); | ||||
| BKE_mesh_update_customdata_pointers(me, false); | BKE_mesh_update_customdata_pointers(me, false); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_sculptsession_bm_to_me(ob, true); | BKE_sculptsession_bm_to_me(ob, true); | ||||
| /* Reset Face Sets as they are no longer valid. */ | |||||
| if (!CustomData_has_layer(&me->pdata, CD_SCULPT_FACE_SETS)) { | |||||
| CustomData_add_layer(&me->pdata, CD_SCULPT_FACE_SETS, CD_CALLOC, NULL, me->totpoly); | |||||
| } | |||||
| ss->face_sets = CustomData_get_layer(&me->pdata, CD_SCULPT_FACE_SETS); | |||||
| for (int i = 0; i < me->totpoly; i++) { | |||||
| ss->face_sets[i] = 1; | |||||
| } | |||||
| me->face_sets_color_default = 1; | |||||
| /* Sync the visibility to vertices manually as the pmap is still not initialized. */ | |||||
| for (int i = 0; i < me->totvert; i++) { | |||||
| SET_FLAG_FROM_TEST(me->mvert[i].flag, false, ME_HIDE); | |||||
jbakker: I wouldn't use `SET_FLAG_FROM_TEST` here. Depending on how smart the compiler is it can remove… | |||||
| me->mvert[i].flag |= ME_VERT_PBVH_UPDATE; | |||||
| } | |||||
| } | } | ||||
| /* Clear data. */ | /* Clear data. */ | ||||
| me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY; | me->flag &= ~ME_SCULPT_DYNAMIC_TOPOLOGY; | ||||
| /* Typically valid but with global-undo they can be NULL. [#36234] */ | /* Typically valid but with global-undo they can be NULL. [#36234] */ | ||||
| if (ss->bm) { | if (ss->bm) { | ||||
| BM_mesh_free(ss->bm); | BM_mesh_free(ss->bm); | ||||
| ▲ Show 20 Lines • Show All 3,044 Lines • Show Last 20 Lines | |||||
I wouldn't use SET_FLAG_FROM_TEST here. Depending on how smart the compiler is it can remove the branching inside the macro (probable it will), but it is just shorter to do
me->mvert[i].flag &= ~ME_HIDE;