Cleanup: Avoid redundant attribute adding in extrude node

These attributes already exist, not need to use the "or_add" function.
This commit is contained in:
Hans Goudey
2023-05-10 15:27:27 -04:00
parent 143ca272bd
commit da43c42e40

View File

@@ -533,8 +533,7 @@ static void extrude_mesh_edges(Mesh &mesh,
if (ELEM(id.name(), ".corner_vert", ".corner_edge", ".edge_verts")) {
return true;
}
GSpanAttributeWriter attribute = attributes.lookup_or_add_for_write_span(
id, meta_data.domain, meta_data.data_type);
GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id);
bke::attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
using T = decltype(dummy);
@@ -934,8 +933,7 @@ static void extrude_mesh_face_regions(Mesh &mesh,
if (ELEM(id.name(), ".corner_vert", ".corner_edge", ".edge_verts")) {
return true;
}
GSpanAttributeWriter attribute = attributes.lookup_or_add_for_write_span(
id, meta_data.domain, meta_data.data_type);
GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id);
bke::attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
using T = decltype(dummy);
@@ -1234,8 +1232,7 @@ static void extrude_individual_mesh_faces(
if (ELEM(id.name(), ".corner_vert", ".corner_edge", ".edge_verts")) {
return true;
}
GSpanAttributeWriter attribute = attributes.lookup_or_add_for_write_span(
id, meta_data.domain, meta_data.data_type);
GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id);
bke::attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
using T = decltype(dummy);