diff options
author | Jacques Lucke <jacques@blender.org> | 2022-10-18 18:16:51 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-10-18 18:17:08 +0300 |
commit | 91e85230f9c1b490f7424b9da7bbd65b7c0c4068 (patch) | |
tree | dd939559f65117c5eadd342d33ca4bdd6499b4e5 /source/blender/blenkernel | |
parent | 91ecf47b2c6b884aadb5550adeda03d5700988d4 (diff) |
Fix T101660: crash when trying to propagate string attributes in some nodes
String attributes are intentionally not fully supported in geometry nodes
yet because more design work is necessary to decide how they should behave.
For now just disable handling string attributes to avoid crashes.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/curve_to_mesh_convert.cc | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curves_geometry.cc | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/geometry_set.cc | 5 |
3 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index b9fea2a27b8..ecf3be9bd81 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -332,7 +332,8 @@ static eAttrDomain get_attribute_domain_for_mesh(const AttributeAccessor &mesh_a static bool should_add_attribute_to_mesh(const AttributeAccessor &curve_attributes, const AttributeAccessor &mesh_attributes, - const AttributeIDRef &id) + const AttributeIDRef &id, + const AttributeMetaData &meta_data) { /* The position attribute has special non-generic evaluation. */ @@ -346,6 +347,9 @@ static bool should_add_attribute_to_mesh(const AttributeAccessor &curve_attribut if (!id.should_be_kept()) { return false; } + if (meta_data.data_type == CD_PROP_STRING) { + return false; + } return true; } @@ -714,7 +718,7 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, MutableAttributeAccessor mesh_attributes = mesh->attributes_for_write(); main_attributes.for_all([&](const AttributeIDRef &id, const AttributeMetaData meta_data) { - if (!should_add_attribute_to_mesh(main_attributes, mesh_attributes, id)) { + if (!should_add_attribute_to_mesh(main_attributes, mesh_attributes, id, meta_data)) { return true; } main_attributes_set.add_new(id); @@ -751,7 +755,7 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, if (main_attributes.contains(id)) { return true; } - if (!should_add_attribute_to_mesh(profile_attributes, mesh_attributes, id)) { + if (!should_add_attribute_to_mesh(profile_attributes, mesh_attributes, id, meta_data)) { return true; } const eAttrDomain src_domain = meta_data.domain; diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index f5c845443f1..29f8d62545f 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -1402,6 +1402,9 @@ void CurvesGeometry::reverse_curves(const IndexMask curves_to_reverse) if (meta_data.domain != ATTR_DOMAIN_POINT) { return true; } + if (meta_data.data_type == CD_PROP_STRING) { + return true; + } if (id.is_named() && bezier_handle_names.contains(id.name())) { return true; } diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc index 90568a8a080..ee4c398c3d6 100644 --- a/source/blender/blenkernel/intern/geometry_set.cc +++ b/source/blender/blenkernel/intern/geometry_set.cc @@ -607,7 +607,10 @@ void GeometrySet::gather_attributes_for_propagation( return; } } - + if (meta_data.data_type == CD_PROP_STRING) { + /* Propagating string attributes is not supported yet. */ + return; + } if (!attribute_id.should_be_kept()) { return; } |