Fix invalid tessellation after vertex smooth with mirror enabled
Smoothing vertices with symmetry wasn't recalculating normals before re-tessellating, meaning the faces would use an incorrect 2D projection for tessellation. The error was exposed by an assert.
This commit is contained in:
@@ -2697,15 +2697,19 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: redundant calculation could be avoided if the EDBM API could skip calculation. */
|
||||
bool calc_normals = false;
|
||||
|
||||
/* apply mirror */
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
|
||||
EDBM_verts_mirror_cache_end(em);
|
||||
calc_normals = true;
|
||||
}
|
||||
|
||||
EDBMUpdate_Params params{};
|
||||
params.calc_looptris = true;
|
||||
params.calc_normals = false;
|
||||
params.calc_normals = calc_normals;
|
||||
params.is_destructive = false;
|
||||
EDBM_update(static_cast<Mesh *>(obedit->data), ¶ms);
|
||||
}
|
||||
@@ -2815,15 +2819,19 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* NOTE: redundant calculation could be avoided if the EDBM API could skip calculation. */
|
||||
bool calc_normals = false;
|
||||
|
||||
/* Apply mirror. */
|
||||
if (((Mesh *)obedit->data)->symmetry & ME_SYMMETRY_X) {
|
||||
EDBM_verts_mirror_apply(em, BM_ELEM_SELECT, 0);
|
||||
EDBM_verts_mirror_cache_end(em);
|
||||
calc_normals = true;
|
||||
}
|
||||
|
||||
EDBMUpdate_Params params{};
|
||||
params.calc_looptris = true;
|
||||
params.calc_normals = false;
|
||||
params.calc_normals = calc_normals;
|
||||
params.is_destructive = false;
|
||||
EDBM_update(static_cast<Mesh *>(obedit->data), ¶ms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user