forked from blender/blender
main sync #3
@ -336,14 +336,6 @@ const float (*BKE_mesh_vert_normals_ensure(const struct Mesh *mesh))[3];
|
||||
*/
|
||||
const float (*BKE_mesh_poly_normals_ensure(const struct Mesh *mesh))[3];
|
||||
|
||||
/**
|
||||
* Tag mesh vertex and face normals to be recalculated when/if they are needed later.
|
||||
*
|
||||
* \note Dirty tagged normals are the default state of a new mesh, so tagging them
|
||||
* dirty explicitly is not always necessary if the mesh is created locally.
|
||||
*/
|
||||
void BKE_mesh_normals_tag_dirty(struct Mesh *mesh);
|
||||
|
||||
/**
|
||||
* Retrieve write access to the cached vertex normals, ensuring that they are allocated but *not*
|
||||
* that they are calculated. The provided vertex normals should be the same as if they were
|
||||
|
@ -100,11 +100,6 @@ static void add_v3_v3_atomic(float r[3], const float a[3])
|
||||
* Related to managing normals but not directly related to calculating normals.
|
||||
* \{ */
|
||||
|
||||
void BKE_mesh_normals_tag_dirty(Mesh *mesh)
|
||||
{
|
||||
mesh->runtime->vert_normals_dirty = true;
|
||||
mesh->runtime->poly_normals_dirty = true;
|
||||
}
|
||||
|
||||
float (*BKE_mesh_vert_normals_for_write(Mesh *mesh))[3]
|
||||
{
|
||||
|
@ -246,7 +246,8 @@ void BKE_mesh_tag_edges_split(struct Mesh *mesh)
|
||||
|
||||
void BKE_mesh_tag_positions_changed(Mesh *mesh)
|
||||
{
|
||||
BKE_mesh_normals_tag_dirty(mesh);
|
||||
mesh->runtime->vert_normals_dirty = true;
|
||||
mesh->runtime->poly_normals_dirty = true;
|
||||
free_bvh_cache(*mesh->runtime);
|
||||
mesh->runtime->looptris_cache.tag_dirty();
|
||||
mesh->runtime->bounds_cache.tag_dirty();
|
||||
|
@ -1116,8 +1116,8 @@ void ED_mesh_update(Mesh *mesh, bContext *C, bool calc_edges, bool calc_edges_lo
|
||||
/* Default state is not to have tessface's so make sure this is the case. */
|
||||
BKE_mesh_tessface_clear(mesh);
|
||||
|
||||
/* Tag lazily calculated data as dirty. */
|
||||
BKE_mesh_normals_tag_dirty(mesh);
|
||||
mesh->runtime->vert_normals_dirty = true;
|
||||
mesh->runtime->poly_normals_dirty = true;
|
||||
|
||||
DEG_id_tag_update(&mesh->id, 0);
|
||||
WM_event_add_notifier(C, NC_GEOM | ND_DATA, mesh);
|
||||
|
@ -315,8 +315,7 @@ static void normalEditModifier_do_radial(NormalEditModifierData *enmd,
|
||||
if (do_polynors_fix &&
|
||||
polygons_check_flip(
|
||||
loops, nos.data(), &mesh->ldata, polys, BKE_mesh_poly_normals_for_write(mesh))) {
|
||||
/* We need to recompute vertex normals! */
|
||||
BKE_mesh_normals_tag_dirty(mesh);
|
||||
mesh->runtime->vert_normals_dirty = true;
|
||||
}
|
||||
const bool *sharp_faces = static_cast<const bool *>(
|
||||
CustomData_get_layer_named(&mesh->pdata, CD_PROP_BOOL, "sharp_face"));
|
||||
@ -422,7 +421,7 @@ static void normalEditModifier_do_directional(NormalEditModifierData *enmd,
|
||||
if (do_polynors_fix &&
|
||||
polygons_check_flip(
|
||||
loops, nos.data(), &mesh->ldata, polys, BKE_mesh_poly_normals_for_write(mesh))) {
|
||||
BKE_mesh_normals_tag_dirty(mesh);
|
||||
mesh->runtime->vert_normals_dirty = true;
|
||||
}
|
||||
const bool *sharp_faces = static_cast<const bool *>(
|
||||
CustomData_get_layer_named(&mesh->pdata, CD_PROP_BOOL, "sharp_face"));
|
||||
|
@ -971,7 +971,6 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex
|
||||
|
||||
/* must recalculate normals with vgroups since they can displace unevenly #26888. */
|
||||
if (BKE_mesh_vert_normals_are_dirty(mesh) || do_rim || dvert) {
|
||||
BKE_mesh_normals_tag_dirty(result);
|
||||
}
|
||||
else if (do_shell) {
|
||||
uint i;
|
||||
|
Loading…
Reference in New Issue
Block a user