Cleanup: use more descriptive variable name for the data-mask
Make it explicit this data mask is added to the default mask.
This commit is contained in:
parent
47af235ba9
commit
67307e72ea
|
@ -87,7 +87,7 @@ struct Mesh *BKE_mesh_from_bmesh_for_eval_nomain(struct BMesh *bm,
|
|||
|
||||
struct Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(
|
||||
struct BMEditMesh *em,
|
||||
const struct CustomData_MeshMasks *data_mask,
|
||||
const struct CustomData_MeshMasks *cd_mask_extra,
|
||||
float (*vertexCos)[3],
|
||||
const struct Mesh *me_settings);
|
||||
|
||||
|
|
|
@ -287,13 +287,13 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra
|
|||
if (mti->type == eModifierTypeType_OnlyDeform && mti->deformMatricesEM) {
|
||||
if (!defmats) {
|
||||
const int required_mode = eModifierMode_Realtime | eModifierMode_Editmode;
|
||||
CustomData_MeshMasks data_mask = CD_MASK_BAREMESH;
|
||||
CustomData_MeshMasks cd_mask_extra = CD_MASK_BAREMESH;
|
||||
CDMaskLink *datamasks = modifiers_calcDataMasks(
|
||||
scene, ob, md, &data_mask, required_mode, NULL, NULL);
|
||||
data_mask = datamasks->mask;
|
||||
scene, ob, md, &cd_mask_extra, required_mode, NULL, NULL);
|
||||
cd_mask_extra = datamasks->mask;
|
||||
BLI_linklist_free((LinkNode *)datamasks, NULL);
|
||||
|
||||
me = BKE_mesh_from_editmesh_with_coords_thin_wrap(em, &data_mask, NULL, me_input);
|
||||
me = BKE_mesh_from_editmesh_with_coords_thin_wrap(em, &cd_mask_extra, NULL, me_input);
|
||||
deformedVerts = editbmesh_vert_coords_alloc(em, &numVerts);
|
||||
defmats = MEM_mallocN(sizeof(*defmats) * numVerts, "defmats");
|
||||
|
||||
|
|
|
@ -857,11 +857,11 @@ Mesh *BKE_mesh_from_bmesh_for_eval_nomain(BMesh *bm,
|
|||
* TODO(campbell): support mesh with only an edit-mesh which is lazy initialized.
|
||||
*/
|
||||
Mesh *BKE_mesh_from_editmesh_with_coords_thin_wrap(BMEditMesh *em,
|
||||
const CustomData_MeshMasks *data_mask,
|
||||
const CustomData_MeshMasks *cd_mask_extra,
|
||||
float (*vertexCos)[3],
|
||||
const Mesh *me_settings)
|
||||
{
|
||||
Mesh *me = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, data_mask, me_settings);
|
||||
Mesh *me = BKE_mesh_from_bmesh_for_eval_nomain(em->bm, cd_mask_extra, me_settings);
|
||||
/* Use editmesh directly where possible. */
|
||||
me->runtime.is_original = true;
|
||||
if (vertexCos) {
|
||||
|
|
|
@ -44,7 +44,7 @@ static Mesh *triangulate_mesh(Mesh *mesh,
|
|||
BMesh *bm;
|
||||
int total_edges, i;
|
||||
MEdge *me;
|
||||
CustomData_MeshMasks cddata_masks = {
|
||||
CustomData_MeshMasks cd_mask_extra = {
|
||||
.vmask = CD_MASK_ORIGINDEX, .emask = CD_MASK_ORIGINDEX, .pmask = CD_MASK_ORIGINDEX};
|
||||
|
||||
bool keep_clnors = (flag & MOD_TRIANGULATE_KEEP_CUSTOMLOOP_NORMALS) != 0;
|
||||
|
@ -53,19 +53,19 @@ static Mesh *triangulate_mesh(Mesh *mesh,
|
|||
BKE_mesh_calc_normals_split(mesh);
|
||||
/* We need that one to 'survive' to/from BMesh conversions. */
|
||||
CustomData_clear_layer_flag(&mesh->ldata, CD_NORMAL, CD_FLAG_TEMPORARY);
|
||||
cddata_masks.lmask |= CD_MASK_NORMAL;
|
||||
cd_mask_extra.lmask |= CD_MASK_NORMAL;
|
||||
}
|
||||
|
||||
bm = BKE_mesh_to_bmesh_ex(mesh,
|
||||
&((struct BMeshCreateParams){0}),
|
||||
&((struct BMeshFromMeshParams){
|
||||
.calc_face_normal = true,
|
||||
.cd_mask_extra = cddata_masks,
|
||||
.cd_mask_extra = cd_mask_extra,
|
||||
}));
|
||||
|
||||
BM_mesh_triangulate(bm, quad_method, ngon_method, min_vertices, false, NULL, NULL, NULL);
|
||||
|
||||
result = BKE_mesh_from_bmesh_for_eval_nomain(bm, &cddata_masks, mesh);
|
||||
result = BKE_mesh_from_bmesh_for_eval_nomain(bm, &cd_mask_extra, mesh);
|
||||
BM_mesh_free(bm);
|
||||
|
||||
if (keep_clnors) {
|
||||
|
|
Loading…
Reference in New Issue