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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user