28 float index = ma ? ma->
index : 0.0f;
37 NodeItem res = empty();
38 std::string
name = socket_out_->identifier;
40 if (
name ==
"Location") {
41 res = create_node(
"position", NodeItem::Type::Vector3, {{
"space", val(std::string(
"world"))}});
43 else if (
name ==
"Random") {
44 res = create_node(
"randomfloat", NodeItem::Type::Float);
47 res = get_output_default(
name, NodeItem::Type::Any);
64 ntype.
ui_description =
"Retrieve information about the object instance";
67 ntype.
declare = file_ns::node_declare;
68 ntype.
gpu_fn = file_ns::node_shader_gpu_object_info;
#define SH_NODE_OBJECT_INFO
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
@ GPU_MATFLAG_OBJECT_INFO
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
Material * GPU_material_get_material(GPUMaterial *material)
void node_register_type(bNodeType &ntype)
static int node_shader_gpu_object_info(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_object_info()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare