20 b.add_input<
decl::Float>(
N_(
"Value"),
"Value_Float").hide_value().supports_field();
21 b.add_input<
decl::Int>(
N_(
"Value"),
"Value_Int").hide_value().supports_field();
22 b.add_input<
decl::Vector>(
N_(
"Value"),
"Value_Vector").hide_value().supports_field();
23 b.add_input<
decl::Color>(
N_(
"Value"),
"Value_Color").hide_value().supports_field();
24 b.add_input<
decl::Bool>(
N_(
"Value"),
"Value_Bool").hide_value().supports_field();
26 b.add_output<
decl::Float>(
N_(
"Value"),
"Value_Float").field_source();
27 b.add_output<
decl::Int>(
N_(
"Value"),
"Value_Int").field_source();
29 b.add_output<
decl::Color>(
N_(
"Value"),
"Value_Color").field_source();
30 b.add_output<
decl::Bool>(
N_(
"Value"),
"Value_Bool").field_source();
35 uiItemR(layout,
ptr,
"data_type", 0,
"", ICON_NONE);
36 uiItemR(layout,
ptr,
"domain", 0,
"", ICON_NONE);
87 params.update_and_connect_available_socket(
node,
"Value");
101 index_field_(
std::move(index_field)),
102 value_field_(
std::move(value_field)),
103 value_field_domain_(value_field_domain)
113 component.attribute_domain_size(value_field_domain_)};
114 value_evaluator.add(value_field_);
115 value_evaluator.evaluate();
116 const GVArray &values = value_evaluator.get_evaluated(0);
120 index_evaluator.add(index_field_);
121 index_evaluator.evaluate();
126 using T = decltype(dummy);
130 for (const int i : mask.slice(range)) {
131 const int index = indices[i];
132 if (index >= 0 && index < src_values.size()) {
133 dst_array[i] = src_values[index];
174 using T = decltype(dummy);
178 std::make_shared<FieldAtIndex>(std::move(index_field), std::move(value_field), domain)};
179 params.set_output(identifier, std::move(output_field));
#define NODE_CLASS_CONVERTER
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
#define GEO_NODE_FIELD_AT_INDEX
void nodeRegisterType(struct bNodeType *ntype)
#define BLI_assert_unreachable()
static uint8 component(Color32 c, uint i)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
VArray< T > typed() const
static VArray ForContainer(ContainerT container)
Span< SocketDeclarationPtr > inputs() const
FieldAtIndex(Field< int > index_field, GField value_field, eAttrDomain value_field_domain)
GVArray get_varray_for_context(const GeometryComponent &component, const eAttrDomain domain, IndexMask mask) const final
ccl_gpu_kernel_postfix int ccl_global int * indices
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
void convert_to_static_type(const CPPType &cpp_type, const Func &func)
static StringRefNull identifier_suffix(eCustomDataType data_type)
static void node_update(bNodeTree *ntree, bNode *node)
static void node_geo_exec(GeoNodeExecParams params)
static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_init(bNodeTree *UNUSED(tree), bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
std::optional< eCustomDataType > node_data_type_to_custom_data_type(const eNodeSocketDatatype type)
void search_link_ops_for_declarations(GatherLinkSearchOpParams ¶ms, Span< SocketDeclarationPtr > declarations)
void parallel_for(IndexRange range, int64_t grain_size, const Function &function)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static void node_init(const struct bContext *C, bNodeTree *ntree, bNode *node)
void register_node_type_geo_field_at_index()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
struct bNodeSocket * next
NodeGeometryExecFunction geometry_node_execute
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
void(* updatefunc)(struct bNodeTree *ntree, struct bNode *node)
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeDeclareFunction declare
void(* initfunc)(struct bNodeTree *ntree, struct bNode *node)