Fix: GPv3: Add missing check in get_mutable_attribute

The function didn't return early in case the domain was empty.
The fix makes sure we return an empty `MutableSpan` in this case
(add doesn't try to create a new custom data layer).
This commit is contained in:
Falk David
2024-03-12 11:16:59 +01:00
parent 692de6d380
commit fd92647f34

View File

@@ -266,6 +266,9 @@ static MutableSpan<T> get_mutable_attribute(CurvesGeometry &curves,
const T default_value = T())
{
const int num = domain_num(curves, domain);
if (num == 0) {
return {};
}
const eCustomDataType type = cpp_type_to_custom_data_type(CPPType::get<T>());
CustomData &custom_data = domain_custom_data(curves, domain);