Cleanup: Remove unnecessary namespace specification

This commit is contained in:
Hans Goudey 2023-12-28 11:23:40 -05:00
parent d206907d76
commit 9daa6d8115
12 changed files with 98 additions and 101 deletions

View File

@ -631,7 +631,7 @@ static void mesh_calc_modifiers(Depsgraph *depsgraph,
}
if (mti->type == ModifierTypeType::OnlyDeform && !sculpt_dyntopo) {
blender::bke::ScopedModifierTimer modifier_timer{*md};
ScopedModifierTimer modifier_timer{*md};
if (!mesh_final) {
mesh_final = BKE_mesh_copy_for_eval(mesh_input);
ASSERT_IS_VALID_MESH(mesh_final);

View File

@ -194,7 +194,7 @@ void gather_to_groups(const OffsetIndices<int> dst_offsets,
const GSpan src,
GMutableSpan dst)
{
bke::attribute_math::convert_to_static_type(src.type(), [&](auto dummy) {
attribute_math::convert_to_static_type(src.type(), [&](auto dummy) {
using T = decltype(dummy);
array_utils::gather_to_groups(dst_offsets, src_selection, src.typed<T>(), dst.typed<T>());
});

View File

@ -366,7 +366,7 @@ template<typename T>
}
[[nodiscard]] static bool load_attributes(const io::serialize::ArrayValue &io_attributes,
bke::MutableAttributeAccessor &attributes,
MutableAttributeAccessor &attributes,
const BlobReader &blob_reader,
const BlobSharing &blob_sharing)
{
@ -403,7 +403,7 @@ template<typename T>
if (attributes.contains(*name)) {
/* If the attribute exists already, copy the values over to the existing array. */
bke::GSpanAttributeWriter attribute = attributes.lookup_or_add_for_write_only_span(
GSpanAttributeWriter attribute = attributes.lookup_or_add_for_write_only_span(
*name, *domain, *data_type);
if (!attribute) {
return false;
@ -446,7 +446,7 @@ static PointCloud *try_load_pointcloud(const DictionaryValue &io_geometry,
return nullptr;
};
bke::MutableAttributeAccessor attributes = pointcloud->attributes_for_write();
MutableAttributeAccessor attributes = pointcloud->attributes_for_write();
if (!load_attributes(*io_attributes, attributes, blob_reader, blob_sharing)) {
return cancel();
}
@ -467,8 +467,8 @@ static Curves *try_load_curves(const DictionaryValue &io_geometry,
return nullptr;
}
Curves *curves_id = bke::curves_new_nomain(0, 0);
bke::CurvesGeometry &curves = curves_id->geometry.wrap();
Curves *curves_id = curves_new_nomain(0, 0);
CurvesGeometry &curves = curves_id->geometry.wrap();
CustomData_free_layer_named(&curves.point_data, "position", 0);
curves.point_num = io_curves->lookup_int("num_points").value_or(0);
curves.curve_num = io_curves->lookup_int("num_curves").value_or(0);
@ -494,7 +494,7 @@ static Curves *try_load_curves(const DictionaryValue &io_geometry,
}
}
bke::MutableAttributeAccessor attributes = curves.attributes_for_write();
MutableAttributeAccessor attributes = curves.attributes_for_write();
if (!load_attributes(*io_attributes, attributes, blob_reader, blob_sharing)) {
return cancel();
}
@ -549,7 +549,7 @@ static Mesh *try_load_mesh(const DictionaryValue &io_geometry,
}
}
bke::MutableAttributeAccessor attributes = mesh->attributes_for_write();
MutableAttributeAccessor attributes = mesh->attributes_for_write();
if (!load_attributes(*io_attributes, attributes, blob_reader, blob_sharing)) {
return cancel();
}
@ -561,9 +561,9 @@ static GeometrySet load_geometry(const DictionaryValue &io_geometry,
const BlobReader &blob_reader,
const BlobSharing &blob_sharing);
static std::unique_ptr<bke::Instances> try_load_instances(const DictionaryValue &io_geometry,
const BlobReader &blob_reader,
const BlobSharing &blob_sharing)
static std::unique_ptr<Instances> try_load_instances(const DictionaryValue &io_geometry,
const BlobReader &blob_reader,
const BlobSharing &blob_sharing)
{
const DictionaryValue *io_instances = io_geometry.lookup_dict("instances");
if (!io_instances) {
@ -582,7 +582,7 @@ static std::unique_ptr<bke::Instances> try_load_instances(const DictionaryValue
return nullptr;
}
std::unique_ptr<bke::Instances> instances = std::make_unique<bke::Instances>();
std::unique_ptr<Instances> instances = std::make_unique<Instances>();
instances->resize(num_instances);
for (const auto &io_reference_value : io_references->elements()) {
@ -610,7 +610,7 @@ static std::unique_ptr<bke::Instances> try_load_instances(const DictionaryValue
return {};
}
bke::MutableAttributeAccessor attributes = instances->attributes_for_write();
MutableAttributeAccessor attributes = instances->attributes_for_write();
if (!load_attributes(*io_attributes, attributes, blob_reader, blob_sharing)) {
return {};
}
@ -650,39 +650,38 @@ static std::shared_ptr<io::serialize::ArrayValue> serialize_material_slots(
}
static std::shared_ptr<io::serialize::ArrayValue> serialize_attributes(
const bke::AttributeAccessor &attributes,
const AttributeAccessor &attributes,
BlobWriter &blob_writer,
BlobSharing &blob_sharing,
const Set<std::string> &attributes_to_ignore)
{
auto io_attributes = std::make_shared<io::serialize::ArrayValue>();
attributes.for_all(
[&](const bke::AttributeIDRef &attribute_id, const bke::AttributeMetaData &meta_data) {
BLI_assert(!attribute_id.is_anonymous());
if (attributes_to_ignore.contains_as(attribute_id.name())) {
return true;
}
attributes.for_all([&](const AttributeIDRef &attribute_id, const AttributeMetaData &meta_data) {
BLI_assert(!attribute_id.is_anonymous());
if (attributes_to_ignore.contains_as(attribute_id.name())) {
return true;
}
auto io_attribute = io_attributes->append_dict();
auto io_attribute = io_attributes->append_dict();
io_attribute->append_str("name", attribute_id.name());
io_attribute->append_str("name", attribute_id.name());
const StringRefNull domain_name = get_domain_io_name(meta_data.domain);
io_attribute->append_str("domain", domain_name);
const StringRefNull domain_name = get_domain_io_name(meta_data.domain);
io_attribute->append_str("domain", domain_name);
const StringRefNull type_name = get_data_type_io_name(meta_data.data_type);
io_attribute->append_str("type", type_name);
const StringRefNull type_name = get_data_type_io_name(meta_data.data_type);
io_attribute->append_str("type", type_name);
const bke::GAttributeReader attribute = attributes.lookup(attribute_id);
const GVArraySpan attribute_span(attribute.varray);
io_attribute->append("data",
write_blob_shared_simple_gspan(
blob_writer,
blob_sharing,
attribute_span,
attribute.varray.is_span() ? attribute.sharing_info : nullptr));
return true;
});
const GAttributeReader attribute = attributes.lookup(attribute_id);
const GVArraySpan attribute_span(attribute.varray);
io_attribute->append("data",
write_blob_shared_simple_gspan(
blob_writer,
blob_sharing,
attribute_span,
attribute.varray.is_span() ? attribute.sharing_info : nullptr));
return true;
});
return io_attributes;
}
@ -729,7 +728,7 @@ static std::shared_ptr<DictionaryValue> serialize_geometry_set(const GeometrySet
}
if (geometry.has_curves()) {
const Curves &curves_id = *geometry.get_curves();
const bke::CurvesGeometry &curves = curves_id.geometry.wrap();
const CurvesGeometry &curves = curves_id.geometry.wrap();
auto io_curves = io_geometry->append_dict("curves");
@ -752,14 +751,14 @@ static std::shared_ptr<DictionaryValue> serialize_geometry_set(const GeometrySet
io_curves->append("attributes", io_attributes);
}
if (geometry.has_instances()) {
const bke::Instances &instances = *geometry.get_instances();
const Instances &instances = *geometry.get_instances();
auto io_instances = io_geometry->append_dict("instances");
io_instances->append_int("num_instances", instances.instances_num());
auto io_references = io_instances->append_array("references");
for (const bke::InstanceReference &reference : instances.references()) {
BLI_assert(reference.type() == bke::InstanceReference::Type::GeometrySet);
for (const InstanceReference &reference : instances.references()) {
BLI_assert(reference.type() == InstanceReference::Type::GeometrySet);
io_references->append(
serialize_geometry_set(reference.geometry_set(), blob_writer, blob_sharing));
}

View File

@ -1132,7 +1132,7 @@ BVHTree *BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data,
}
const Span<float3> positions = mesh->vert_positions();
const Span<blender::int2> edges = mesh->edges();
const Span<int2> edges = mesh->edges();
const Span<int> corner_verts = mesh->corner_verts();
/* Setup BVHTreeFromMesh */
@ -1160,7 +1160,7 @@ BVHTree *BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data,
switch (bvh_cache_type) {
case BVHTREE_FROM_LOOSEVERTS: {
const blender::bke::LooseVertCache &loose_verts = mesh->loose_verts();
const LooseVertCache &loose_verts = mesh->loose_verts();
data->tree = bvhtree_from_mesh_verts_create_tree(
0.0f, tree_type, 6, positions, loose_verts.is_loose_bits, loose_verts.count);
break;
@ -1170,7 +1170,7 @@ BVHTree *BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data,
break;
}
case BVHTREE_FROM_LOOSEEDGES: {
const blender::bke::LooseEdgeCache &loose_edges = mesh->loose_edges();
const LooseEdgeCache &loose_edges = mesh->loose_edges();
data->tree = bvhtree_from_mesh_edges_create_tree(
positions, edges, loose_edges.is_loose_bits, loose_edges.count, 0.0f, tree_type, 6);
break;
@ -1194,7 +1194,7 @@ BVHTree *BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data,
break;
}
case BVHTREE_FROM_CORNER_TRIS_NO_HIDDEN: {
blender::bke::AttributeAccessor attributes = mesh->attributes();
AttributeAccessor attributes = mesh->attributes();
int mask_bits_act_len = -1;
const BitVector<> mask = corner_tris_no_hidden_map_get(
mesh->faces(),

View File

@ -557,7 +557,7 @@ static void calculate_evaluated_offsets(const CurvesGeometry &curves,
OffsetIndices<int> CurvesGeometry::evaluated_points_by_curve() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
if (this->is_single_type(CURVE_TYPE_POLY)) {
/* When all the curves are poly curves, the evaluated offsets are the same as the control
* point offsets, so it's possible to completely avoid building a new offsets array. */
@ -607,7 +607,7 @@ Array<int> CurvesGeometry::point_to_curve_map() const
void CurvesGeometry::ensure_nurbs_basis_cache() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
runtime.nurbs_basis_cache.ensure([&](Vector<curves::nurbs::BasisCache> &r_data) {
IndexMaskMemory memory;
const IndexMask nurbs_mask = this->indices_for_curve_type(CURVE_TYPE_NURBS, memory);
@ -650,7 +650,7 @@ void CurvesGeometry::ensure_nurbs_basis_cache() const
Span<float3> CurvesGeometry::evaluated_positions() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
if (this->is_single_type(CURVE_TYPE_POLY)) {
runtime.evaluated_position_cache.ensure(
[&](Vector<float3> &r_data) { r_data.clear_and_shrink(); });
@ -729,7 +729,7 @@ Span<float3> CurvesGeometry::evaluated_positions() const
Span<float3> CurvesGeometry::evaluated_tangents() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
runtime.evaluated_tangent_cache.ensure([&](Vector<float3> &r_data) {
const OffsetIndices<int> evaluated_points_by_curve = this->evaluated_points_by_curve();
const Span<float3> evaluated_positions = this->evaluated_positions();
@ -843,7 +843,7 @@ static void evaluate_generic_data_for_curve(const EvalData &eval_data,
Span<float3> CurvesGeometry::evaluated_normals() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
this->ensure_nurbs_basis_cache();
runtime.evaluated_normal_cache.ensure([&](Vector<float3> &r_data) {
const OffsetIndices<int> points_by_curve = this->points_by_curve();
@ -940,7 +940,7 @@ void CurvesGeometry::interpolate_to_evaluated(const int curve_index,
const GSpan src,
GMutableSpan dst) const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
const EvalData eval_data{
this->points_by_curve(),
this->curve_types(),
@ -958,7 +958,7 @@ void CurvesGeometry::interpolate_to_evaluated(const int curve_index,
void CurvesGeometry::interpolate_to_evaluated(const GSpan src, GMutableSpan dst) const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
const OffsetIndices points_by_curve = this->points_by_curve();
const EvalData eval_data{
points_by_curve,
@ -984,7 +984,7 @@ void CurvesGeometry::interpolate_to_evaluated(const GSpan src, GMutableSpan dst)
void CurvesGeometry::ensure_evaluated_lengths() const
{
const bke::CurvesGeometryRuntime &runtime = *this->runtime;
const CurvesGeometryRuntime &runtime = *this->runtime;
runtime.evaluated_length_cache.ensure([&](Vector<float> &r_data) {
/* Use an extra length value for the final cyclic segment for a consistent size
* (see comment on #evaluated_length_cache). */

View File

@ -24,9 +24,9 @@ void fill_points(const OffsetIndices<int> points_by_curve,
});
}
bke::CurvesGeometry copy_only_curve_domain(const bke::CurvesGeometry &src_curves)
CurvesGeometry copy_only_curve_domain(const CurvesGeometry &src_curves)
{
bke::CurvesGeometry dst_curves(0, src_curves.curves_num());
CurvesGeometry dst_curves(0, src_curves.curves_num());
CustomData_copy(
&src_curves.curve_data, &dst_curves.curve_data, CD_MASK_ALL, src_curves.curves_num());
dst_curves.runtime->type_counts = src_curves.runtime->type_counts;

View File

@ -142,14 +142,14 @@ const Curve *CurveComponent::get_curve_for_render() const
/** \name Curve Normals Access
* \{ */
static Array<float3> curve_normal_point_domain(const bke::CurvesGeometry &curves)
static Array<float3> curve_normal_point_domain(const CurvesGeometry &curves)
{
const OffsetIndices points_by_curve = curves.points_by_curve();
const OffsetIndices evaluated_points_by_curve = curves.evaluated_points_by_curve();
const VArray<int8_t> types = curves.curve_types();
const VArray<int> resolutions = curves.resolution();
const VArray<bool> curves_cyclic = curves.cyclic();
const bke::AttributeAccessor attributes = curves.attributes();
const AttributeAccessor attributes = curves.attributes();
const VArray<float3> custom_normals = *attributes.lookup_or_default<float3>(
"custom_normal", AttrDomain::Point, float3(0, 0, 1));
@ -197,13 +197,13 @@ static Array<float3> curve_normal_point_domain(const bke::CurvesGeometry &curves
nurbs_tangents.resize(points.size());
const bool cyclic = curves_cyclic[i_curve];
const Span<float3> curve_positions = positions.slice(points);
bke::curves::poly::calculate_tangents(curve_positions, cyclic, nurbs_tangents);
curves::poly::calculate_tangents(curve_positions, cyclic, nurbs_tangents);
switch (NormalMode(normal_modes[i_curve])) {
case NORMAL_MODE_Z_UP:
bke::curves::poly::calculate_normals_z_up(nurbs_tangents, curve_normals);
curves::poly::calculate_normals_z_up(nurbs_tangents, curve_normals);
break;
case NORMAL_MODE_MINIMUM_TWIST:
bke::curves::poly::calculate_normals_minimum(nurbs_tangents, cyclic, curve_normals);
curves::poly::calculate_normals_minimum(nurbs_tangents, cyclic, curve_normals);
break;
case NORMAL_MODE_FREE:
custom_normals.materialize(points, curve_normals);
@ -292,7 +292,7 @@ bool CurveLengthFieldInput::is_equal_to(const fn::FieldNode &other) const
}
std::optional<AttrDomain> CurveLengthFieldInput::preferred_domain(
const bke::CurvesGeometry & /*curves*/) const
const CurvesGeometry & /*curves*/) const
{
return AttrDomain::Curve;
}
@ -366,7 +366,7 @@ class CurvesVertexGroupsAttributeProvider final : public DynamicAttributesProvid
static const float default_value = 0.0f;
return {VArray<float>::ForSingle(default_value, curves->points_num()), AttrDomain::Point};
}
return {bke::varray_for_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
return {varray_for_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
}
GAttributeWriter try_get_for_write(void *owner, const AttributeIDRef &attribute_id) const final
@ -385,7 +385,7 @@ class CurvesVertexGroupsAttributeProvider final : public DynamicAttributesProvid
return {};
}
MutableSpan<MDeformVert> dverts = curves->deform_verts_for_write();
return {bke::varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
return {varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
}
bool try_delete(void *owner, const AttributeIDRef &attribute_id) const final
@ -412,7 +412,7 @@ class CurvesVertexGroupsAttributeProvider final : public DynamicAttributesProvid
}
MutableSpan<MDeformVert> dverts = curves->deform_verts_for_write();
bke::remove_defgroup_index(dverts, index);
remove_defgroup_index(dverts, index);
return true;
}

View File

@ -75,8 +75,8 @@ static void remember_deformed_grease_pencil_if_necessary(const GreasePencil *gre
}
const GreasePencil &orig_grease_pencil =
edit_component.grease_pencil_edit_hints_->grease_pencil_id_orig;
const Span<const bke::greasepencil::Layer *> layers = grease_pencil->layers();
const Span<const bke::greasepencil::Layer *> orig_layers = orig_grease_pencil.layers();
const Span<const greasepencil::Layer *> layers = grease_pencil->layers();
const Span<const greasepencil::Layer *> orig_layers = orig_grease_pencil.layers();
const int layers_num = layers.size();
if (layers_num != orig_layers.size()) {
return;
@ -85,10 +85,10 @@ static void remember_deformed_grease_pencil_if_necessary(const GreasePencil *gre
MutableSpan<GreasePencilDrawingEditHints> all_hints =
*edit_component.grease_pencil_edit_hints_->drawing_hints;
for (const int layer_index : layers.index_range()) {
const bke::greasepencil::Drawing *drawing = greasepencil::get_eval_grease_pencil_layer_drawing(
const greasepencil::Drawing *drawing = greasepencil::get_eval_grease_pencil_layer_drawing(
*grease_pencil, layer_index);
const bke::greasepencil::Layer &orig_layer = *orig_layers[layer_index];
const bke::greasepencil::Drawing *orig_drawing = orig_grease_pencil.get_drawing_at(
const greasepencil::Layer &orig_layer = *orig_layers[layer_index];
const greasepencil::Drawing *orig_drawing = orig_grease_pencil.get_drawing_at(
&orig_layer, grease_pencil->runtime->eval_frame);
GreasePencilDrawingEditHints &drawing_hints = all_hints[layer_index];

View File

@ -892,7 +892,7 @@ class MeshVertexGroupsAttributeProvider final : public DynamicAttributesProvider
static const float default_value = 0.0f;
return {VArray<float>::ForSingle(default_value, mesh->verts_num), AttrDomain::Point};
}
return {bke::varray_for_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
return {varray_for_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
}
GAttributeWriter try_get_for_write(void *owner, const AttributeIDRef &attribute_id) const final
@ -912,7 +912,7 @@ class MeshVertexGroupsAttributeProvider final : public DynamicAttributesProvider
return {};
}
MutableSpan<MDeformVert> dverts = mesh->deform_verts_for_write();
return {bke::varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
return {varray_for_mutable_deform_verts(dverts, vertex_group_index), AttrDomain::Point};
}
bool try_delete(void *owner, const AttributeIDRef &attribute_id) const final
@ -939,7 +939,7 @@ class MeshVertexGroupsAttributeProvider final : public DynamicAttributesProvider
}
MutableSpan<MDeformVert> dverts = mesh->deform_verts_for_write();
bke::remove_defgroup_index(dverts, index);
remove_defgroup_index(dverts, index);
return true;
}

View File

@ -2260,14 +2260,13 @@ void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb,
}
if (face_normals_needed) {
blender::bke::mesh::normals_calc_faces(
positions,
faces,
corner_verts,
{reinterpret_cast<blender::float3 *>(face_normals), faces.size()});
mesh::normals_calc_faces(positions,
faces,
corner_verts,
{reinterpret_cast<blender::float3 *>(face_normals), faces.size()});
}
if (vert_normals_needed) {
blender::bke::mesh::normals_calc_verts(
mesh::normals_calc_verts(
positions,
faces,
corner_verts,
@ -2278,10 +2277,10 @@ void BKE_keyblock_mesh_calc_normals(const KeyBlock *kb,
if (loop_normals_needed) {
const blender::short2 *clnors = static_cast<const blender::short2 *>(
CustomData_get_layer(&mesh->corner_data, CD_CUSTOMLOOPNORMAL));
const bke::AttributeAccessor attributes = mesh->attributes();
const AttributeAccessor attributes = mesh->attributes();
const VArraySpan sharp_edges = *attributes.lookup<bool>("sharp_edge", AttrDomain::Edge);
const VArraySpan sharp_faces = *attributes.lookup<bool>("sharp_face", AttrDomain::Face);
blender::bke::mesh::normals_calc_loop(
mesh::normals_calc_loop(
positions,
edges,
faces,

View File

@ -73,26 +73,25 @@ void mesh_flip_faces(Mesh &mesh, const IndexMask &selection)
});
}
bke::MutableAttributeAccessor attributes = mesh.attributes_for_write();
attributes.for_all(
[&](const bke::AttributeIDRef &attribute_id, const bke::AttributeMetaData &meta_data) {
if (meta_data.data_type == CD_PROP_STRING) {
return true;
}
if (meta_data.domain != AttrDomain::Corner) {
return true;
}
if (ELEM(attribute_id.name(), ".corner_vert", ".corner_edge")) {
return true;
}
bke::GSpanAttributeWriter attribute = attributes.lookup_for_write_span(attribute_id);
bke::attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
using T = decltype(dummy);
flip_corner_data(faces, selection, attribute.span.typed<T>());
});
attribute.finish();
return true;
});
MutableAttributeAccessor attributes = mesh.attributes_for_write();
attributes.for_all([&](const AttributeIDRef &attribute_id, const AttributeMetaData &meta_data) {
if (meta_data.data_type == CD_PROP_STRING) {
return true;
}
if (meta_data.domain != AttrDomain::Corner) {
return true;
}
if (ELEM(attribute_id.name(), ".corner_vert", ".corner_edge")) {
return true;
}
GSpanAttributeWriter attribute = attributes.lookup_for_write_span(attribute_id);
attribute_math::convert_to_static_type(meta_data.data_type, [&](auto dummy) {
using T = decltype(dummy);
flip_corner_data(faces, selection, attribute.span.typed<T>());
});
attribute.finish();
return true;
});
mesh.tag_face_winding_changed();
}

View File

@ -481,7 +481,7 @@ void BaryWeightSampleFn::evaluate_source(fn::GField src_field)
* be possible to use the most complex domain required by the field inputs, to simplify sampling
* and avoid domain conversions. */
domain_ = AttrDomain::Corner;
source_context_.emplace(bke::MeshFieldContext(mesh, domain_));
source_context_.emplace(MeshFieldContext(mesh, domain_));
const int domain_size = mesh.attributes().domain_size(domain_);
source_evaluator_ = std::make_unique<fn::FieldEvaluator>(*source_context_, domain_size);
source_evaluator_->add(std::move(src_field));