Fix T92848: Crash when joining curves with spline domain attributes
The point domain attributes (stored on splines) are sorted so they have a consistent order on all splines after the join. However, spline domain attributes were included in the new order, which didn't work because the length of the attribute lists didn't match. The simple fix is to only include point domain attributes in the new order vector.
This commit is contained in:
parent
7c75529333
commit
594ee5f160
Notes:
blender-bot
2023-02-14 06:42:54 +01:00
Referenced by issue #92848, Geometry Nodes: Attribute Capture crash when joining curves
|
@ -540,8 +540,11 @@ static void sort_curve_point_attributes(const Map<AttributeIDRef, AttributeKind>
|
|||
MutableSpan<SplinePtr> splines)
|
||||
{
|
||||
Vector<AttributeIDRef> new_order;
|
||||
for (const AttributeIDRef attribute_id : info.keys()) {
|
||||
new_order.append(attribute_id);
|
||||
for (Map<AttributeIDRef, AttributeKind>::Item item : info.items()) {
|
||||
if (item.value.domain == ATTR_DOMAIN_POINT) {
|
||||
/* Only sort attributes stored on splines. */
|
||||
new_order.append(item.key);
|
||||
}
|
||||
}
|
||||
for (SplinePtr &spline : splines) {
|
||||
spline->attributes.reorder(new_order);
|
||||
|
|
|
@ -366,8 +366,11 @@ static void sort_curve_point_attributes(const Map<AttributeIDRef, AttributeMetaD
|
|||
MutableSpan<SplinePtr> splines)
|
||||
{
|
||||
Vector<AttributeIDRef> new_order;
|
||||
for (const AttributeIDRef attribute_id : info.keys()) {
|
||||
new_order.append(attribute_id);
|
||||
for (Map<AttributeIDRef, AttributeMetaData>::Item item : info.items()) {
|
||||
if (item.value.domain == ATTR_DOMAIN_POINT) {
|
||||
/* Only sort attributes stored on splines. */
|
||||
new_order.append(item.key);
|
||||
}
|
||||
}
|
||||
for (SplinePtr &spline : splines) {
|
||||
spline->attributes.reorder(new_order);
|
||||
|
|
Loading…
Reference in New Issue