Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_transfer_attribute.cc
| Show First 20 Lines • Show All 403 Lines • ▼ Show 20 Lines | void call(IndexMask mask, fn::MFParams params, fn::MFContext UNUSED(context)) const override | ||||
| const Mesh &mesh = *mesh_component.get_for_read(); | const Mesh &mesh = *mesh_component.get_for_read(); | ||||
| BLI_assert(mesh.totpoly > 0); | BLI_assert(mesh.totpoly > 0); | ||||
| /* Find closest points on the mesh surface. */ | /* Find closest points on the mesh surface. */ | ||||
| Array<int> looptri_indices(mask.min_array_size()); | Array<int> looptri_indices(mask.min_array_size()); | ||||
| Array<float3> sampled_positions(mask.min_array_size()); | Array<float3> sampled_positions(mask.min_array_size()); | ||||
| get_closest_mesh_looptris(mesh, positions, mask, looptri_indices, {}, sampled_positions); | get_closest_mesh_looptris(mesh, positions, mask, looptri_indices, {}, sampled_positions); | ||||
| MeshAttributeInterpolator interp(&mesh, sampled_positions, looptri_indices); | MeshAttributeInterpolator interp(&mesh, mask, sampled_positions, looptri_indices); | ||||
| interp.sample_data(*target_data_, domain_, eAttributeMapMode::INTERPOLATED, mask, dst); | interp.sample_data(*target_data_, domain_, eAttributeMapMode::INTERPOLATED, dst); | ||||
| } | } | ||||
| private: | private: | ||||
| void evaluate_target_field() | void evaluate_target_field() | ||||
| { | { | ||||
| const MeshComponent &mesh_component = *target_.get_component_for_read<MeshComponent>(); | const MeshComponent &mesh_component = *target_.get_component_for_read<MeshComponent>(); | ||||
| target_context_.emplace(GeometryComponentFieldContext{mesh_component, domain_}); | target_context_.emplace(GeometryComponentFieldContext{mesh_component, domain_}); | ||||
| const int domain_size = mesh_component.attribute_domain_size(domain_); | const int domain_size = mesh_component.attribute_domain_size(domain_); | ||||
| ▲ Show 20 Lines • Show All 411 Lines • Show Last 20 Lines | |||||