20 b.add_input<
decl::Float>(
N_(
"Value"),
"Value_001").supports_field();
21 b.add_input<
decl::Color>(
N_(
"Value"),
"Value_002").supports_field();
22 b.add_input<
decl::Bool>(
N_(
"Value"),
"Value_003").supports_field();
23 b.add_input<
decl::Int>(
N_(
"Value"),
"Value_004").supports_field();
27 b.add_output<
decl::Float>(
N_(
"Attribute"),
"Attribute_001").field_source();
28 b.add_output<
decl::Color>(
N_(
"Attribute"),
"Attribute_002").field_source();
29 b.add_output<
decl::Bool>(
N_(
"Attribute"),
"Attribute_003").field_source();
30 b.add_output<
decl::Int>(
N_(
"Attribute"),
"Attribute_004").field_source();
37 uiItemR(layout,
ptr,
"data_type", 0,
"", ICON_NONE);
38 uiItemR(layout,
ptr,
"domain", 0,
"", ICON_NONE);
95 node_storage(
node).data_type = *
type;
96 params.update_and_connect_available_socket(
node,
"Attribute");
102 node_storage(
node).data_type = *
type;
103 params.update_and_connect_available_socket(
node,
"Value");
114 const int domain_size =
component.attribute_domain_size(domain);
115 if (domain_size == 0) {
124 attribute_id, domain, data_type);
125 if (!output_attribute) {
130 evaluator.add_with_destination(field, output_attribute.
varray);
131 evaluator.evaluate();
133 output_attribute.
finish();
159 if (!
params.output_is_required(
"Geometry")) {
162 TIP_(
"The attribute output can not be used without the geometry output"));
163 params.set_default_remaining_outputs();
171 const std::string output_identifier =
"Attribute" +
identifier_suffix(data_type);
173 if (!
params.output_is_required(output_identifier)) {
174 params.set_output(
"Geometry", geometry_set);
219 GeometryComponent &component = geometry_set.get_component_for_write(type);
220 try_capture_field_on_geometry(component, anonymous_id.get(), domain, field);
226 GField output_field{std::make_shared<bke::AnonymousAttributeFieldInput>(
227 std::move(anonymous_id),
type,
params.attribute_producer_name())};
254 params.set_output(
"Geometry", geometry_set);
268 "NodeGeometryAttributeCapture",
@ GEO_COMPONENT_TYPE_MESH
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_CURVE
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
#define NODE_STORAGE_FUNCS(StorageT)
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
#define GEO_NODE_CAPTURE_ATTRIBUTE
#define NODE_CLASS_ATTRIBUTE
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
in reality light always falls off quadratically Particle Info
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
GAttributeWriter lookup_or_add_for_write(const AttributeIDRef &attribute_id, const eAttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefault())
const CPPType & cpp_type() const
Span< SocketDeclarationPtr > outputs() const
Span< SocketDeclarationPtr > inputs() const
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
OwnedAnonymousAttributeID< false > WeakAnonymousAttributeID
eCustomDataType cpp_type_to_custom_data_type(const blender::CPPType &type)
static void node_update(bNodeTree *ntree, bNode *node)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_init(bNodeTree *UNUSED(tree), bNode *node)
static StringRefNull identifier_suffix(eCustomDataType data_type)
static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms)
static void try_capture_field_on_geometry(GeometryComponent &component, const AttributeIDRef &attribute_id, const eAttrDomain domain, const GField &field)
std::optional< eCustomDataType > node_data_type_to_custom_data_type(const eNodeSocketDatatype type)
void search_link_ops_for_declarations(GatherLinkSearchOpParams ¶ms, Span< SocketDeclarationPtr > declarations)
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_attribute_capture()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
bool has(const GeometryComponentType component_type) const
bool has_instances() const
void modify_geometry_sets(ForeachSubGeometryCallback callback)
struct bNodeSocket * next
NodeGeometryExecFunction geometry_node_execute
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeDeclareFunction declare