From 128ebdb062404fa54fdae72043058655a504ade1 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 1 Dec 2021 12:44:02 -0500 Subject: Fix: Remove incorrect asserts for empty attributes While it is an edge case, it isn't incorrect for the attribute storage to have a zero size, it will just return an empty span or nothing. --- source/blender/blenkernel/intern/attribute_access.cc | 3 --- 1 file changed, 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 5663f6b8756..79070500888 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -744,7 +744,6 @@ CustomDataAttributes &CustomDataAttributes::operator=(const CustomDataAttributes std::optional CustomDataAttributes::get_for_read(const AttributeIDRef &attribute_id) const { - BLI_assert(size_ != 0); for (const CustomDataLayer &layer : Span(data.layers, data.totlayer)) { if (custom_data_layer_matches_attribute_id(layer, attribute_id)) { const CPPType *cpp_type = custom_data_type_to_cpp_type((CustomDataType)layer.type); @@ -783,8 +782,6 @@ GVArray CustomDataAttributes::get_for_read(const AttributeIDRef &attribute_id, std::optional CustomDataAttributes::get_for_write(const AttributeIDRef &attribute_id) { - /* If this assert hits, it most likely means that #reallocate was not called at some point. */ - BLI_assert(size_ != 0); for (CustomDataLayer &layer : MutableSpan(data.layers, data.totlayer)) { if (custom_data_layer_matches_attribute_id(layer, attribute_id)) { const CPPType *cpp_type = custom_data_type_to_cpp_type((CustomDataType)layer.type); -- cgit v1.2.3