Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mesh_runtime.cc
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | static void mesh_ensure_looptri_data(Mesh *mesh) | ||||
| } | } | ||||
| } | } | ||||
| void BKE_mesh_runtime_looptri_recalc(Mesh *mesh) | void BKE_mesh_runtime_looptri_recalc(Mesh *mesh) | ||||
| { | { | ||||
| mesh_ensure_looptri_data(mesh); | mesh_ensure_looptri_data(mesh); | ||||
| BLI_assert(mesh->totpoly == 0 || mesh->runtime.looptris.array_wip != nullptr); | BLI_assert(mesh->totpoly == 0 || mesh->runtime.looptris.array_wip != nullptr); | ||||
| if (BKE_mesh_poly_normals_are_dirty(mesh)) { | |||||
| BKE_mesh_recalc_looptri(mesh->mloop, | BKE_mesh_recalc_looptri(mesh->mloop, | ||||
| mesh->mpoly, | mesh->mpoly, | ||||
| mesh->mvert, | mesh->mvert, | ||||
| mesh->totloop, | mesh->totloop, | ||||
| mesh->totpoly, | mesh->totpoly, | ||||
| mesh->runtime.looptris.array_wip); | mesh->runtime.looptris.array_wip); | ||||
| } | |||||
| else { | |||||
| BKE_mesh_recalc_looptri_with_normals(mesh->mloop, | |||||
| mesh->mpoly, | |||||
| mesh->mvert, | |||||
| mesh->totloop, | |||||
| mesh->totpoly, | |||||
| mesh->runtime.looptris.array_wip, | |||||
| BKE_mesh_poly_normals_ensure(mesh)); | |||||
| } | |||||
| BLI_assert(mesh->runtime.looptris.array == nullptr); | BLI_assert(mesh->runtime.looptris.array == nullptr); | ||||
| atomic_cas_ptr((void **)&mesh->runtime.looptris.array, | atomic_cas_ptr((void **)&mesh->runtime.looptris.array, | ||||
| mesh->runtime.looptris.array, | mesh->runtime.looptris.array, | ||||
| mesh->runtime.looptris.array_wip); | mesh->runtime.looptris.array_wip); | ||||
| mesh->runtime.looptris.array_wip = nullptr; | mesh->runtime.looptris.array_wip = nullptr; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines | |||||