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,110 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_free_layers(&me->pdata, CD_SCULPT_FACE_SETS, me->totpoly); | |||||
| } | |||||
| 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; | |||||
| } | |||||
| me->face_sets_color_default = 1; | |||||
| } | } | ||||
| /* Clear data. */ | /* Clear data. */ | ||||
jbakker: I wouldn't use `SET_FLAG_FROM_TEST` here. Depending on how smart the compiler is it can remove… | |||||
| 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); | ||||
| ss->bm = NULL; | ss->bm = NULL; | ||||
| } | } | ||||
| if (ss->bm_log) { | if (ss->bm_log) { | ||||
| ▲ Show 20 Lines • Show All 3,014 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;