Blender  V2.93
node_fn_input_vector.cc
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #include "node_function_util.hh"
18 
19 #include "BLI_hash.h"
20 
21 #include "UI_interface.h"
22 #include "UI_resources.h"
23 
25  {SOCK_VECTOR, N_("Vector")},
26  {-1, ""},
27 };
28 
30 {
31  uiLayout *col = uiLayoutColumn(layout, true);
32  uiItemR(col, ptr, "vector", UI_ITEM_R_EXPAND, "", ICON_NONE);
33 }
34 
37 {
38  bNode &bnode = builder.bnode();
39  NodeInputVector *node_storage = static_cast<NodeInputVector *>(bnode.storage);
40  blender::float3 vector(node_storage->vector);
41 
43 }
44 
46 {
48  "input vector node");
49  node->storage = data;
50 }
51 
53 {
54  static bNodeType ntype;
55 
56  fn_node_type_base(&ntype, FN_NODE_INPUT_VECTOR, "Vector", 0, 0);
60  &ntype, "NodeInputVector", node_free_standard_storage, node_copy_standard_storage);
63  nodeRegisterType(&ntype);
64 }
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
#define FN_NODE_INPUT_VECTOR
Definition: BKE_node.h:1429
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4559
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))
Definition: node.cc:4599
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
#define UNUSED(x)
#define N_(msgid)
@ SOCK_VECTOR
#define C
Definition: RandGen.cpp:39
@ UI_ITEM_R_EXPAND
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
uint col
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
std::vector< ElementType, Eigen::aligned_allocator< ElementType > > vector
Definition: vector.h:39
static void fn_node_input_vector_init(bNodeTree *UNUSED(ntree), bNode *node)
void register_node_type_fn_input_vector()
static void fn_node_input_vector_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void fn_node_vector_input_expand_in_mf_network(blender::nodes::NodeMFNetworkBuilder &builder)
static bNodeSocketTemplate fn_node_input_vector_out[]
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:67
void node_free_standard_storage(bNode *node)
Definition: node_util.c:55
Compact definition of a node socket.
Definition: BKE_node.h:95
Defines a node type.
Definition: BKE_node.h:221
NodeExpandInMFNetworkFunction expand_in_mf_network
Definition: BKE_node.h:324
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:253
void * storage
PointerRNA * ptr
Definition: wm_files.c:3157