Differential D12638 Diff 43459 source/blender/nodes/geometry/nodes/legacy/node_geo_attribute_transfer.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/legacy/node_geo_attribute_transfer.cc
| Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | if (!src_attribute || !dst_attribute) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* Find closest points on the mesh surface. */ | /* Find closest points on the mesh surface. */ | ||||
| Array<int> looptri_indices(tot_samples); | Array<int> looptri_indices(tot_samples); | ||||
| Array<float3> positions(tot_samples); | Array<float3> positions(tot_samples); | ||||
| get_closest_mesh_looptris(*mesh, dst_positions, looptri_indices, {}, positions); | get_closest_mesh_looptris(*mesh, dst_positions, looptri_indices, {}, positions); | ||||
| bke::mesh_surface_sample::MeshAttributeInterpolator interp(mesh, positions, looptri_indices); | bke::mesh_surface_sample::MeshAttributeInterpolator interp( | ||||
| mesh, IndexMask(tot_samples), positions, looptri_indices); | |||||
| interp.sample_attribute( | interp.sample_attribute( | ||||
| src_attribute, dst_attribute, bke::mesh_surface_sample::eAttributeMapMode::INTERPOLATED); | src_attribute, dst_attribute, bke::mesh_surface_sample::eAttributeMapMode::INTERPOLATED); | ||||
| dst_attribute.save(); | dst_attribute.save(); | ||||
| } | } | ||||
| static void transfer_attribute_nearest(const GeometrySet &src_geometry, | static void transfer_attribute_nearest(const GeometrySet &src_geometry, | ||||
| GeometryComponent &dst_component, | GeometryComponent &dst_component, | ||||
| ▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines | |||||