15 .
description(
"The corner to retrieve data from. Defaults to the corner from the context")
16 .structure_type(StructureType::Field);
18 "The number of corners to move around the face before finding the result, "
19 "circling around the start of the face if necessary");
21 .field_source_reference_all()
31 :
bke::MeshFieldInput(
CPPType::get<int>(),
"Offset Corner in Face"),
32 corner_index_(std::move(corner_index)),
33 offset_(std::move(offset))
42 const IndexRange corner_range(mesh.corners_num);
47 evaluator.
add(corner_index_);
48 evaluator.
add(offset_);
53 const Span<int> corner_to_face = mesh.corner_to_face_map();
56 mask.foreach_index_optimized<
int>(
GrainSize(2048), [&](
const int selection_i) {
57 const int corner = corner_indices[selection_i];
58 const int offset = offsets[selection_i];
59 if (!corner_to_face.index_range().contains(corner)) {
60 offset_corners[selection_i] = 0;
64 const int corner_index_in_face = corner - face.
start();
66 corner_index_in_face + offset, face.
size());
74 corner_index_.node().for_each_field_input_recursive(
fn);
75 offset_.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>(
112 ntype.
ui_name =
"Offset Corner in Face";
113 ntype.
ui_description =
"Retrieve corners in the same face as another";
#define GEO_NODE_MESH_TOPOLOGY_OFFSET_CORNER_IN_FACE
@ NODE_DEFAULT_INPUT_INDEX_FIELD
#define NOD_REGISTER_NODE(REGISTER_FUNC)
unsigned long long int uint64_t
constexpr int64_t size() const
constexpr int64_t start() const
static VArray from_container(ContainerT container)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void node_register_type(bNodeType &ntype)
T mod_periodic(const T &a, const T &b)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
uint64_t get_default_hash(const T &v, const Args &...args)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare