Changeset View
Changeset View
Standalone View
Standalone View
source/blender/bmesh/intern/bmesh_mesh.c
| Show First 20 Lines • Show All 1,489 Lines • ▼ Show 20 Lines | void BM_lnorspace_rebuild(BMesh *bm, bool preserve_clnor) | ||||
| BMFace *f; | BMFace *f; | ||||
| BMLoop *l; | BMLoop *l; | ||||
| BMIter fiter, liter; | BMIter fiter, liter; | ||||
| float(*r_lnors)[3] = MEM_callocN(sizeof(*r_lnors) * bm->totloop, __func__); | float(*r_lnors)[3] = MEM_callocN(sizeof(*r_lnors) * bm->totloop, __func__); | ||||
| float(*oldnors)[3] = preserve_clnor ? MEM_mallocN(sizeof(*oldnors) * bm->totloop, __func__) : | float(*oldnors)[3] = preserve_clnor ? MEM_mallocN(sizeof(*oldnors) * bm->totloop, __func__) : | ||||
| NULL; | NULL; | ||||
| /* [2] Ensure a CD_CUSTOMLOOPNORMAL in BM_lnorspace_rebuild */ | |||||
| if (!CustomData_has_layer(&bm->ldata, CD_CUSTOMLOOPNORMAL)) { | |||||
| BM_data_layer_add(bm, &bm->ldata, CD_CUSTOMLOOPNORMAL); | |||||
| } | |||||
| int cd_loop_clnors_offset = CustomData_get_offset(&bm->ldata, CD_CUSTOMLOOPNORMAL); | int cd_loop_clnors_offset = CustomData_get_offset(&bm->ldata, CD_CUSTOMLOOPNORMAL); | ||||
| BM_mesh_elem_index_ensure(bm, BM_LOOP); | BM_mesh_elem_index_ensure(bm, BM_LOOP); | ||||
| if (preserve_clnor) { | if (preserve_clnor) { | ||||
| BLI_assert(bm->lnor_spacearr->lspacearr != NULL); | BLI_assert(bm->lnor_spacearr->lspacearr != NULL); | ||||
| BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { | BM_ITER_MESH (f, &fiter, bm, BM_FACES_OF_MESH) { | ||||
| ▲ Show 20 Lines • Show All 1,580 Lines • Show Last 20 Lines | |||||