From 98060efcf1a2c8d5dd50a40d1d85224ebff63a7d Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 14 Jan 2025 22:29:03 -0500 Subject: [PATCH] Fix #132537: Assert when baking with string attribute Propagating string attributes isn't supported in many places currently, the split edges node is not an exception, so skip those attributes as necessary. --- source/blender/geometry/intern/mesh_split_edges.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/blender/geometry/intern/mesh_split_edges.cc b/source/blender/geometry/intern/mesh_split_edges.cc index 808bbd04c76..44e5ffdf7fb 100644 --- a/source/blender/geometry/intern/mesh_split_edges.cc +++ b/source/blender/geometry/intern/mesh_split_edges.cc @@ -29,18 +29,20 @@ static void propagate_vert_attributes(Mesh &mesh, const Span new_to_old_ver bke::MutableAttributeAccessor attributes = mesh.attributes_for_write(); for (const StringRef id : attributes.all_ids()) { - if (attributes.lookup_meta_data(id)->domain != bke::AttrDomain::Point) { + const bke::AttributeMetaData meta_data = *attributes.lookup_meta_data(id); + if (meta_data.domain != bke::AttrDomain::Point) { + continue; + } + if (meta_data.data_type == CD_PROP_STRING) { continue; } bke::GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id); if (!attribute) { continue; } - bke::attribute_math::gather(attribute.span, new_to_old_verts_map, attribute.span.take_back(new_to_old_verts_map.size())); - attribute.finish(); } if (float3 *orco = static_cast( @@ -68,7 +70,11 @@ static void propagate_edge_attributes(Mesh &mesh, const Span new_to_old_edg bke::MutableAttributeAccessor attributes = mesh.attributes_for_write(); for (const StringRef id : attributes.all_ids()) { - if (attributes.lookup_meta_data(id)->domain != bke::AttrDomain::Edge) { + const bke::AttributeMetaData meta_data = *attributes.lookup_meta_data(id); + if (meta_data.domain != bke::AttrDomain::Edge) { + continue; + } + if (meta_data.data_type == CD_PROP_STRING) { continue; } if (id == ".edge_verts") {