17 .
description(
"The corner to retrieve data from. Defaults to the corner from the context");
19 "The number of corners to move around the face before finding the result, "
20 "circling around the start of the face if necessary");
22 .field_source_reference_all()
32 : bke::MeshFieldInput(
CPPType::get<
int>(),
"Offset Corner in Face"),
33 corner_index_(std::move(corner_index)),
34 offset_(std::move(offset))
40 const AttrDomain domain,
43 const IndexRange corner_range(mesh.corners_num);
48 evaluator.
add(corner_index_);
49 evaluator.add(offset_);
51 const VArray<int> corner_indices = evaluator.get_evaluated<
int>(0);
52 const VArray<int> offsets = evaluator.get_evaluated<
int>(1);
54 const Span<int> corner_to_face = mesh.corner_to_face_map();
56 Array<int> offset_corners(mask.min_array_size());
57 mask.foreach_index_optimized<
int>(
GrainSize(2048), [&](
const int selection_i) {
58 const int corner_i = corner_indices[selection_i];
59 const int offset = offsets[selection_i];
60 if (!corner_range.
contains(corner_i)) {
61 offset_corners[selection_i] = 0;
65 const IndexRange face = faces[corner_to_face[corner_i]];
74 corner_index_.node().for_each_field_input_recursive(fn);
88 return other_field->corner_index_ == corner_index_ && other_field->offset_ == offset_;
95 return AttrDomain::Corner;
101 params.set_output(
"Corner Index",
102 Field<int>(std::make_shared<OffsetCornerInFaceFieldInput>(
111 GEO_NODE_MESH_TOPOLOGY_OFFSET_CORNER_IN_FACE,
112 "Offset Corner in Face",
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr bool contains(int64_t value) const
static VArray ForContainer(ContainerT container)
int add(GField field, GVArray *varray_ptr)
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() 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
void node_register_type(bNodeType *ntype)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
int apply_offset_in_cyclic_range(IndexRange range, int start_index, int offset)
uint64_t get_default_hash(const T &v)
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