diff options
author | Iliay Katueshenock <Moder> | 2022-07-14 11:04:35 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-07-14 11:05:24 +0300 |
commit | 77df9d788a2bb9d7173f10edf3631dc26ccce8ed (patch) | |
tree | f69020ff161ee8204698f8b76ed68826396ff1db /source/blender | |
parent | f48fadc953f68ba24084bb277ff2ca05ddaa289d (diff) |
Fix T99239: weird behavior in Field on Domain node
Diffstat (limited to 'source/blender')
-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); } }; |