Blender V4.3
node_fn_input_vector.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
7#include "UI_interface.hh"
8#include "UI_resources.hh"
9
11
13{
14 b.add_output<decl::Vector>("Vector");
15}
16
17static void node_layout(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
18{
19 uiLayout *col = uiLayoutColumn(layout, true);
20 uiItemR(col, ptr, "vector", UI_ITEM_R_EXPAND, "", ICON_NONE);
21}
22
24{
25 const bNode &bnode = builder.node();
26 NodeInputVector *node_storage = static_cast<NodeInputVector *>(bnode.storage);
27 float3 vector(node_storage->vector);
29}
30
31static void node_init(bNodeTree * /*tree*/, bNode *node)
32{
33 NodeInputVector *data = MEM_cnew<NodeInputVector>(__func__);
34 node->storage = data;
35}
36
37static void node_register()
38{
39 static blender::bke::bNodeType ntype;
40
41 fn_node_type_base(&ntype, FN_NODE_INPUT_VECTOR, "Vector", 0);
42 ntype.declare = node_declare;
43 ntype.initfunc = node_init;
45 &ntype, "NodeInputVector", node_free_standard_storage, node_copy_standard_storage);
49}
51
52} // namespace blender::nodes::node_fn_input_vector_cc
#define NOD_REGISTER_NODE(REGISTER_FUNC)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a vector
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_EXPAND
local_group_size(16, 16) .push_constant(Type b
uint col
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
Definition node.cc:4632
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_declare(NodeDeclarationBuilder &b)
static void node_init(bNodeTree *, bNode *node)
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
void fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
Definition node_util.cc:46
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
Definition node_util.cc:58
void * storage
Defines a node type.
Definition BKE_node.hh:218
void(* initfunc)(bNodeTree *ntree, bNode *node)
Definition BKE_node.hh:267
NodeMultiFunctionBuildFunction build_multi_function
Definition BKE_node.hh:336
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:238
NodeDeclareFunction declare
Definition BKE_node.hh:347
PointerRNA * ptr
Definition wm_files.cc:4126