Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_point_distribute.cc
| Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | for (const int i : bary_coords.index_range()) { | ||||
| const T &v2 = data_in[loop_index_2]; | const T &v2 = data_in[loop_index_2]; | ||||
| const T interpolated_value = attribute_math::mix3(bary_coord, v0, v1, v2); | const T interpolated_value = attribute_math::mix3(bary_coord, v0, v1, v2); | ||||
| data_out[i] = interpolated_value; | data_out[i] = interpolated_value; | ||||
| } | } | ||||
| } | } | ||||
| template<typename T> | template<typename T> | ||||
| BLI_NOINLINE static void interpolate_attribute_polygon(const Mesh &mesh, | BLI_NOINLINE static void interpolate_attribute_face(const Mesh &mesh, | ||||
| const Span<int> looptri_indices, | const Span<int> looptri_indices, | ||||
| const Span<T> data_in, | const Span<T> data_in, | ||||
| MutableSpan<T> data_out) | MutableSpan<T> data_out) | ||||
| { | { | ||||
| BLI_assert(data_in.size() == mesh.totpoly); | BLI_assert(data_in.size() == mesh.totpoly); | ||||
| Span<MLoopTri> looptris = get_mesh_looptris(mesh); | Span<MLoopTri> looptris = get_mesh_looptris(mesh); | ||||
| for (const int i : data_out.index_range()) { | for (const int i : data_out.index_range()) { | ||||
| const int looptri_index = looptri_indices[i]; | const int looptri_index = looptri_indices[i]; | ||||
| const MLoopTri &looptri = looptris[looptri_index]; | const MLoopTri &looptri = looptris[looptri_index]; | ||||
| const int poly_index = looptri.poly; | const int poly_index = looptri.poly; | ||||
| Show All 14 Lines | case ATTR_DOMAIN_POINT: { | ||||
| interpolate_attribute_point<T>(mesh, bary_coords, looptri_indices, source_span, output_span); | interpolate_attribute_point<T>(mesh, bary_coords, looptri_indices, source_span, output_span); | ||||
| break; | break; | ||||
| } | } | ||||
| case ATTR_DOMAIN_CORNER: { | case ATTR_DOMAIN_CORNER: { | ||||
| interpolate_attribute_corner<T>( | interpolate_attribute_corner<T>( | ||||
| mesh, bary_coords, looptri_indices, source_span, output_span); | mesh, bary_coords, looptri_indices, source_span, output_span); | ||||
| break; | break; | ||||
| } | } | ||||
| case ATTR_DOMAIN_POLYGON: { | case ATTR_DOMAIN_FACE: { | ||||
| interpolate_attribute_polygon<T>(mesh, looptri_indices, source_span, output_span); | interpolate_attribute_face<T>(mesh, looptri_indices, source_span, output_span); | ||||
| break; | break; | ||||
| } | } | ||||
| default: { | default: { | ||||
| /* Not supported currently. */ | /* Not supported currently. */ | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines | |||||