diff options
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_field_on_domain.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_field_on_domain.cc b/source/blender/nodes/geometry/nodes/node_geo_field_on_domain.cc index 5939ed5334d..59e243db4a2 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_field_on_domain.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_field_on_domain.cc @@ -85,12 +85,13 @@ class FieldOnDomain final : public GeometryFieldInput { IndexMask /* mask */) const final { const GeometryComponentFieldContext context{component, src_domain_}; - FieldEvaluator value_evaluator{context, component.attribute_domain_size(src_domain_)}; - value_evaluator.add(src_field_); + const int64_t src_domain_size = component.attribute_domain_size(src_domain_); + GArray values(src_field_.cpp_type(), src_domain_size); + FieldEvaluator value_evaluator{context, src_domain_size}; + value_evaluator.add_with_destination(src_field_, values.as_mutable_span()); value_evaluator.evaluate(); - const GVArray &values = value_evaluator.get_evaluated(0); - - return component.attributes()->adapt_domain(values, src_domain_, domain); + return component.attributes()->adapt_domain( + GVArray::ForGArray(std::move(values)), src_domain_, domain); } }; |