Differential D12689 Diff 42663 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 398 Lines • ▼ Show 20 Lines | if (use_mesh && use_pointcloud) { | ||||
| /* When there is a mesh and a pointcloud, we still have to check whether a pointcloud point or | /* When there is a mesh and a pointcloud, we still have to check whether a pointcloud point or | ||||
| * a mesh element is closer to every point. */ | * a mesh element is closer to every point. */ | ||||
| ReadAttributeLookup pointcloud_src_attribute = | ReadAttributeLookup pointcloud_src_attribute = | ||||
| pointcloud_component->attribute_try_get_for_read(src_name, data_type); | pointcloud_component->attribute_try_get_for_read(src_name, data_type); | ||||
| ReadAttributeLookup mesh_src_attribute = mesh_component->attribute_try_get_for_read(src_name, | ReadAttributeLookup mesh_src_attribute = mesh_component->attribute_try_get_for_read(src_name, | ||||
| data_type); | data_type); | ||||
| for (const int i : IndexRange(tot_samples)) { | for (const int i : IndexRange(tot_samples)) { | ||||
| if (pointcloud_distances_sq[i] < mesh_distances_sq[i]) { | if (pointcloud_distances_sq[i] < mesh_distances_sq[i]) { | ||||
| /* Pointcloud point is closer. */ | /* Point-cloud point is closer. */ | ||||
| const int index = pointcloud_indices[i]; | const int index = pointcloud_indices[i]; | ||||
| pointcloud_src_attribute.varray->get(index, buffer); | pointcloud_src_attribute.varray->get(index, buffer); | ||||
| dst_attribute->set_by_relocate(i, buffer); | dst_attribute->set_by_relocate(i, buffer); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Mesh element is closer. */ | /* Mesh element is closer. */ | ||||
| const int index = mesh_indices[i]; | const int index = mesh_indices[i]; | ||||
| mesh_src_attribute.varray->get(index, buffer); | mesh_src_attribute.varray->get(index, buffer); | ||||
| ▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines | |||||