51 float attr_hash = 0.0f;
59 GPU_link(mat,
"node_attribute_color", cd_attr, &cd_attr);
61 else if (
STREQ(attr->
name,
"temperature")) {
62 GPU_link(mat,
"node_attribute_temperature", cd_attr, &cd_attr);
72 reinterpret_cast<uint32_t *
>(&attr_hash));
94 return get_output_default(socket_out_->identifier, NodeItem::Type::Any);
110 ntype.
ui_description =
"Retrieve attributes attached to objects or geometry";
113 ntype.
declare = file_ns::node_declare;
114 ntype.
draw_buttons = file_ns::node_shader_buts_attribute;
115 ntype.
initfunc = file_ns::node_shader_init_attribute;
118 ntype.
gpu_fn = file_ns::node_shader_gpu_attribute;
#define SH_NODE_ATTRIBUTE
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
@ SHD_ATTRIBUTE_VIEW_LAYER
@ SHD_ATTRIBUTE_INSTANCER
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
GPUNodeLink * GPU_layer_attribute(GPUMaterial *mat, const char *name)
GPUNodeLink * GPU_uniform_attribute(GPUMaterial *mat, const char *name, bool use_dupli, uint32_t *r_hash)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
static int node_shader_gpu_attribute(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_init_attribute(bNodeTree *, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_attribute(uiLayout *layout, bContext *, PointerRNA *ptr)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_attribute()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)