parent
25ab53a4af
commit
2618c1d71d
|
@ -291,25 +291,10 @@ static void rna_Curves_add_curves(Curves *curves_id,
|
||||||
|
|
||||||
/* Initialize new attribute values, since #CurvesGeometry::resize() doesn't do that. */
|
/* Initialize new attribute values, since #CurvesGeometry::resize() doesn't do that. */
|
||||||
bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
|
bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
|
||||||
attributes.for_all(
|
bke::fill_attribute_range_default(
|
||||||
[&](const bke::AttributeIDRef &id, const bke::AttributeMetaData /*meta_data*/) {
|
attributes, ATTR_DOMAIN_POINT, {}, curves.points_range().drop_front(orig_points_num));
|
||||||
bke::GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id);
|
bke::fill_attribute_range_default(
|
||||||
GMutableSpan new_data;
|
attributes, ATTR_DOMAIN_CURVE, {}, curves.curves_range().drop_front(orig_curves_num));
|
||||||
switch (attribute.domain) {
|
|
||||||
case ATTR_DOMAIN_POINT:
|
|
||||||
new_data = attribute.span.drop_front(orig_points_num);
|
|
||||||
break;
|
|
||||||
case ATTR_DOMAIN_CURVE:
|
|
||||||
new_data = attribute.span.drop_front(orig_curves_num);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
BLI_assert_unreachable();
|
|
||||||
}
|
|
||||||
const CPPType &type = attribute.span.type();
|
|
||||||
type.fill_construct_n(type.default_value(), new_data.data(), new_data.size());
|
|
||||||
attribute.finish();
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
|
|
||||||
curves.update_curve_types();
|
curves.update_curve_types();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue