Implements part of #101689. The "poly" name was chosen to distinguish the `MLoop` + `MPoly` combination from the `MFace` struct it replaced. Those two structures persisted together for a long time, but nowadays `MPoly` is gone, and `MFace` is only used in some legacy code like the particle system. To avoid unnecessarily using a different term, increase consistency with the UI and with BMesh, and generally make code a bit easier to read, this commit replaces the `poly` term with `poly`. Most variables that use the term are renamed too. `Mesh.totface` and `Mesh.fdata` now have a `_legacy` suffix to reduce confusion. In a next step, `pdata` can be renamed to `face_data` as well. Pull Request: https://projects.blender.org/blender/blender/pulls/109819
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
/* SPDX-FileCopyrightText: 2023 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
#pragma once
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
*/
|
|
|
|
#include "BLI_array.hh"
|
|
#include "BLI_math_vector_types.hh"
|
|
|
|
struct BMEditMesh;
|
|
|
|
namespace blender::bke {
|
|
|
|
struct EditMeshData {
|
|
/** when set, \a vertexNos, faceNos are lazy initialized */
|
|
Array<float3> vertexCos;
|
|
|
|
/** lazy initialize (when \a vertexCos is set) */
|
|
Array<float3> vertexNos;
|
|
Array<float3> faceNos;
|
|
/** also lazy init but don't depend on \a vertexCos */
|
|
Array<float3> faceCos;
|
|
};
|
|
|
|
} // namespace blender::bke
|
|
|
|
void BKE_editmesh_cache_ensure_face_normals(BMEditMesh *em, blender::bke::EditMeshData *emd);
|
|
void BKE_editmesh_cache_ensure_vert_normals(BMEditMesh *em, blender::bke::EditMeshData *emd);
|
|
|
|
void BKE_editmesh_cache_ensure_face_centers(BMEditMesh *em, blender::bke::EditMeshData *emd);
|
|
|
|
bool BKE_editmesh_cache_calc_minmax(BMEditMesh *em,
|
|
blender::bke::EditMeshData *emd,
|
|
float min[3],
|
|
float max[3]);
|