40 NodeItem vector = get_input_value(
"Vector", NodeItem::Type::Vector3);
42 get_input_value(
"Index", NodeItem::Type::Integer).convert(NodeItem::Type::Float);
45 NodeItem::CompareOp::Eq,
48 index.if_else(NodeItem::CompareOp::Eq,
51 index.if_else(NodeItem::CompareOp::Eq, val(2.0f), vector[2], val(0.0f))));
61 ntype.
ui_name =
"Get Vector Component";
62 ntype.
ui_description =
"Get the X, Y or Z component of a vector by index";
#define NODE_CLASS_CONVERTER
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_matching_fn(const mf::MultiFunction *fn)
void node_register_type(bNodeType &ntype)
const MultiFunction & lookup(UString id)
static int node_gpu_material(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
NODE_SHADER_MATERIALX_BEGIN static NODE_SHADER_MATERIALX_END void node_register()
static void node_declare(NodeDeclarationBuilder &b)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void common_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
static constexpr int _160
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
NodeDeclareFunction declare