diff options
author | Hans Goudey <h.goudey@me.com> | 2021-11-05 18:55:51 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-05 18:55:51 +0300 |
commit | 594ee5f160dd7cbe29d7c406299629ddfacb39ad (patch) | |
tree | 8594505b33a62986435565a20f7f685e63d6b551 /source/blender/blenkernel | |
parent | 7c755293330e8ebe8717b0a34e6031b4e3186f0d (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/geometry_set_instances.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc index a56c7ffb295..8a7840acd73 100644 --- a/source/blender/blenkernel/intern/geometry_set_instances.cc +++ b/source/blender/blenkernel/intern/geometry_set_instances.cc @@ -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); |