Differential D16858 Diff 59011 source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_corners_of_vertex.cc
| Show All 19 Lines | b.add_input<decl::Float>(N_("Weights")) | ||||
| .hide_value() | .hide_value() | ||||
| .description( | .description( | ||||
| N_("Values used to sort corners attached to the vertex. Uses indices by default")); | N_("Values used to sort corners attached to the vertex. Uses indices by default")); | ||||
| b.add_input<decl::Int>(N_("Sort Index")) | b.add_input<decl::Int>(N_("Sort Index")) | ||||
| .min(0) | .min(0) | ||||
| .supports_field() | .supports_field() | ||||
| .description(N_("Which of the sorted corners to output")); | .description(N_("Which of the sorted corners to output")); | ||||
| b.add_output<decl::Int>(N_("Corner Index")) | b.add_output<decl::Int>(N_("Corner Index")) | ||||
| .dependent_field() | .field_source_reference_all() | ||||
| .description(N_("A corner connected to the face, chosen by the sort index")); | .description(N_("A corner connected to the face, chosen by the sort index")); | ||||
| b.add_output<decl::Int>(N_("Total")) | b.add_output<decl::Int>(N_("Total")) | ||||
| .dependent_field() | .field_source() | ||||
| .reference_pass({0}) | |||||
| .description(N_("The number of faces or corners connected to each vertex")); | .description(N_("The number of faces or corners connected to each vertex")); | ||||
| } | } | ||||
| static void convert_span(const Span<int> src, MutableSpan<int64_t> dst) | static void convert_span(const Span<int> src, MutableSpan<int64_t> dst) | ||||
| { | { | ||||
| for (const int i : src.index_range()) { | for (const int i : src.index_range()) { | ||||
| dst[i] = src[i]; | dst[i] = src[i]; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | threading::parallel_for(mask.index_range(), 1024, [&](const IndexRange range) { | ||||
| const int index_in_sort_wrapped = mod_i(index_in_sort, corners.size()); | const int index_in_sort_wrapped = mod_i(index_in_sort, corners.size()); | ||||
| corner_of_vertex[selection_i] = corner_indices[sort_indices[index_in_sort_wrapped]]; | corner_of_vertex[selection_i] = corner_indices[sort_indices[index_in_sort_wrapped]]; | ||||
| } | } | ||||
| }); | }); | ||||
| return VArray<int>::ForContainer(std::move(corner_of_vertex)); | return VArray<int>::ForContainer(std::move(corner_of_vertex)); | ||||
| } | } | ||||
| void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const | |||||
| { | |||||
| vert_index_.node().for_each_field_input_recursive(fn); | |||||
| sort_index_.node().for_each_field_input_recursive(fn); | |||||
| sort_weight_.node().for_each_field_input_recursive(fn); | |||||
| } | |||||
| uint64_t hash() const final | uint64_t hash() const final | ||||
| { | { | ||||
| return 3541871368173645; | return 3541871368173645; | ||||
| } | } | ||||
| bool is_equal_to(const fn::FieldNode &other) const final | bool is_equal_to(const fn::FieldNode &other) const final | ||||
| { | { | ||||
| if (const auto *typed = dynamic_cast<const CornersOfVertInput *>(&other)) { | if (const auto *typed = dynamic_cast<const CornersOfVertInput *>(&other)) { | ||||
| ▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines | |||||