18 .
description(
"The face to retrieve data from. Defaults to the face from the context");
20 "Values used to sort the face's corners. Uses indices by default");
24 .
description(
"Which of the sorted corners to output");
26 .field_source_reference_all()
27 .
description(
"A corner of the face, chosen by the sort index");
28 b.add_output<
decl::Int>(
"Total").field_source().reference_pass({0}).description(
29 "The number of corners in the face");
40 face_index_(std::move(face_index)),
41 sort_index_(std::move(sort_index)),
42 sort_weight_(std::move(sort_weight))
55 evaluator.
add(face_index_);
56 evaluator.
add(sort_index_);
63 corner_evaluator.
add(sort_weight_);
66 const bool use_sorting = !all_sort_weights.
is_single();
74 for (
const int selection_i : segment) {
75 const int face_i = face_indices[selection_i];
76 const int index_in_sort = indices_in_sort[selection_i];
77 if (!
faces.index_range().contains(face_i)) {
78 corner_of_face[selection_i] = 0;
84 const int index_in_sort_wrapped =
mod_i(index_in_sort, corners.
size());
97 std::stable_sort(sort_indices.
begin(), sort_indices.
end(), [&](
int a,
int b) {
98 return sort_weights[a] < sort_weights[b];
100 corner_of_face[selection_i] = corners[sort_indices[index_in_sort_wrapped]];
103 corner_of_face[selection_i] = corners[index_in_sort_wrapped];
113 face_index_.node().for_each_field_input_recursive(
fn);
114 sort_index_.node().for_each_field_input_recursive(
fn);
115 sort_weight_.node().for_each_field_input_recursive(
fn);
120 return 6927982716657;
126 return typed->face_index_ == face_index_ && typed->sort_index_ == sort_index_ &&
127 typed->sort_weight_ == sort_weight_;
134 return AttrDomain::Face;
149 if (domain != AttrDomain::Face) {
159 return 8345908765432698;
169 return AttrDomain::Face;
176 if (
params.output_is_required(
"Total")) {
177 params.set_output(
"Total",
178 Field<int>(std::make_shared<bke::EvaluateAtIndexInput>(
180 Field<int>(std::make_shared<CornersOfFaceCountInput>()),
183 if (
params.output_is_required(
"Corner Index")) {
184 params.set_output(
"Corner Index",
185 Field<int>(std::make_shared<CornersOfFaceInput>(
#define GEO_NODE_MESH_TOPOLOGY_CORNERS_OF_FACE
MINLINE int mod_i(int i, int n)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
MutableSpan< T > as_mutable_span()
void reinitialize(const int64_t new_size)
constexpr int64_t size() const
void materialize_compressed(const IndexMask &mask, MutableSpan< T > r_span) const
static VArray ForContainer(ContainerT container)
static VArray ForFunc(const int64_t size, GetFunc get_func)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
local_group_size(16, 16) .push_constant(Type b
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
ccl_device_inline float4 mask(const int4 mask, const float4 a)
void fill_index_range(MutableSpan< T > span, const T start=0)
void node_register_type(bNodeType *ntype)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
unsigned __int64 uint64_t
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare