Mesh: Replace auto smooth with node group #108014
|
@ -816,9 +816,10 @@ static void create_mesh(Scene *scene,
|
|||
const blender::OffsetIndices faces = b_mesh.faces();
|
||||
const blender::Span<int> corner_verts = b_mesh.corner_verts();
|
||||
const blender::bke::AttributeAccessor b_attributes = b_mesh.attributes();
|
||||
const blender::bke::MeshNormalDomain normals_domain = b_mesh.normals_domain();
|
||||
int numfaces = (!subdivision) ? b_mesh.looptris().size() : faces.size();
|
||||
|
||||
bool use_loop_normals = b_mesh.normals_domain() == blender::bke::MeshNormalDomain::Corner &&
|
||||
bool use_loop_normals = normals_domain == blender::bke::MeshNormalDomain::Corner &&
|
||||
(mesh->get_subdivision_type() != Mesh::SUBDIVISION_CATMULL_CLARK);
|
||||
|
||||
/* If no faces, create empty mesh. */
|
||||
|
@ -937,7 +938,8 @@ static void create_mesh(Scene *scene,
|
|||
}
|
||||
}
|
||||
else {
|
||||
std::fill(smooth, smooth + numtris, true);
|
||||
/* If only face normals are needed, all faces are sharp. */
|
||||
std::fill(smooth, smooth + numtris, normals_domain != blender::bke::MeshNormalDomain::Face);
|
||||
}
|
||||
|
||||
if (use_loop_normals && !corner_normals.is_empty()) {
|
||||
|
|
Loading…
Reference in New Issue