BKE: Utilities to create curves and point clouds without attributes #120368
|
@ -1398,9 +1398,8 @@ void CurvesGeometry::remove_attributes_based_on_types()
|
|||
|
||||
CurvesGeometry curves_new_no_attributes(int point_num, int curve_num)
|
||||
{
|
||||
CurvesGeometry curves(0, 0);
|
||||
CurvesGeometry curves(0, curve_num);
|
||||
curves.point_num = point_num;
|
||||
curves.curve_num = curve_num;
|
||||
|
||||
CustomData_free_layer_named(&curves.point_data, "position", 0);
|
||||
|
||||
|
|
|
@ -42,14 +42,6 @@ components_supported_reordering()
|
|||
return supported_types_and_domains;
|
||||
}
|
||||
|
||||
static void remove_attributes(const Span<StringRef> names,
|
||||
bke::MutableAttributeAccessor attributes)
|
||||
{
|
||||
for (const StringRef name : names) {
|
||||
attributes.remove(name);
|
||||
}
|
||||
}
|
||||
|
||||
static void reorder_attributes_group_to_group(
|
||||
const bke::AttributeAccessor src_attributes,
|
||||
const bke::AttrDomain domain,
|
||||
|
@ -106,8 +98,6 @@ static void copy_and_reorder_mesh_verts(
|
|||
const bke::AttributeAccessor src_attributes = src_mesh.attributes();
|
||||
bke::MutableAttributeAccessor dst_attributes = dst_mesh.attributes_for_write();
|
||||
|
||||
remove_attributes({"position", ".edge_verts", ".corner_vert", ".corner_edge"}, dst_attributes);
|
||||
|
||||
bke::copy_attributes(
|
||||
src_attributes, bke::AttrDomain::Edge, propagation_info, {}, dst_attributes);
|
||||
bke::copy_attributes(
|
||||
|
@ -144,8 +134,6 @@ static void copy_and_reorder_mesh_edges(
|
|||
const bke::AttributeAccessor src_attributes = src_mesh.attributes();
|
||||
bke::MutableAttributeAccessor dst_attributes = dst_mesh.attributes_for_write();
|
||||
|
||||
remove_attributes({"position", ".edge_verts", ".corner_vert", ".corner_edge"}, dst_attributes);
|
||||
|
||||
bke::copy_attributes(
|
||||
src_attributes, bke::AttrDomain::Point, propagation_info, {}, dst_attributes);
|
||||
bke::copy_attributes(
|
||||
|
@ -175,8 +163,6 @@ static void copy_and_reorder_mesh_faces(
|
|||
const bke::AttributeAccessor src_attributes = src_mesh.attributes();
|
||||
bke::MutableAttributeAccessor dst_attributes = dst_mesh.attributes_for_write();
|
||||
|
||||
remove_attributes({"position", ".edge_verts", ".corner_vert", ".corner_edge"}, dst_attributes);
|
||||
|
||||
bke::copy_attributes(
|
||||
src_attributes, bke::AttrDomain::Point, propagation_info, {}, dst_attributes);
|
||||
bke::copy_attributes(
|
||||
|
@ -315,8 +301,8 @@ bke::CurvesGeometry reorder_curves_geometry(
|
|||
const Span<int> old_by_new_map,
|
||||
const bke::AnonymousAttributePropagationInfo &propagation_info)
|
||||
{
|
||||
bke::CurvesGeometry dst_curves = bke::CurvesGeometry(src_curves.points_num(),
|
||||
src_curves.curves_num());
|
||||
bke::CurvesGeometry dst_curves = bke::curves_new_no_attributes(src_curves.points_num(),
|
||||
src_curves.curves_num());
|
||||
copy_and_reorder_curves(src_curves, old_by_new_map, propagation_info, dst_curves);
|
||||
return dst_curves;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue