Blender  V3.3
source/blender/nodes/intern/node_util.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2007 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 struct bNode;
15 struct bNodeTree;
16 
17 /* data for initializing node execution */
18 typedef struct bNodeExecContext {
21 
22 typedef struct bNodeExecData {
23  void *data; /* custom data storage */
24  struct bNodePreview *preview; /* optional preview image */
26 
27 /**** Storage Data ****/
28 
29 void node_free_curves(struct bNode *node);
31 
32 void node_copy_curves(struct bNodeTree *dest_ntree,
33  struct bNode *dest_node,
34  const struct bNode *src_node);
35 void node_copy_standard_storage(struct bNodeTree *dest_ntree,
36  struct bNode *dest_node,
37  const struct bNode *src_node);
39  struct bNode *node,
40  bNodeInstanceKey key);
41 
42 /**** Updates ****/
43 void node_sock_label(struct bNodeSocket *sock, const char *name);
44 void node_sock_label_clear(struct bNodeSocket *sock);
45 void node_math_update(struct bNodeTree *ntree, struct bNode *node);
46 
47 /**** Labels ****/
48 void node_blend_label(const struct bNodeTree *ntree,
49  const struct bNode *node,
50  char *label,
51  int maxlen);
52 void node_image_label(const struct bNodeTree *ntree,
53  const struct bNode *node,
54  char *label,
55  int maxlen);
56 void node_math_label(const struct bNodeTree *ntree,
57  const struct bNode *node,
58  char *label,
59  int maxlen);
61  const struct bNode *node,
62  char *label,
63  int maxlen);
64 void node_filter_label(const struct bNodeTree *ntree,
65  const struct bNode *node,
66  char *label,
67  int maxlen);
68 void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode);
69 
70 /*** Link Handling */
71 
77 void node_insert_link_default(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link);
78 
79 float node_socket_get_float(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock);
81  struct bNode *node,
82  struct bNodeSocket *sock,
83  float value);
85  struct bNode *node,
86  struct bNodeSocket *sock,
87  float *value);
89  struct bNode *node,
90  struct bNodeSocket *sock,
91  const float *value);
93  struct bNode *node,
94  struct bNodeSocket *sock,
95  float *value);
97  struct bNode *node,
98  struct bNodeSocket *sock,
99  const float *value);
100 
101 #ifdef __cplusplus
102 }
103 #endif
NodeCombSepColorMode
OperationNode * node
const char * label
bNodeTree * ntree
void node_insert_link_default(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
Definition: node_util.c:326
void node_math_label(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
void node_copy_standard_storage(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node)
struct bNodeExecData bNodeExecData
void node_sock_label_clear(struct bNodeSocket *sock)
Definition: node_util.c:81
void node_sock_label(struct bNodeSocket *sock, const char *name)
Definition: node_util.c:76
void node_blend_label(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
void node_math_update(struct bNodeTree *ntree, struct bNode *node)
Definition: node_util.c:88
void node_free_curves(struct bNode *node)
Definition: node_util.c:38
void node_image_label(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
void * node_initexec_curves(struct bNodeExecContext *context, struct bNode *node, bNodeInstanceKey key)
void node_filter_label(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
void node_socket_get_vector(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, float *value)
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode)
Definition: node_util.c:229
void node_free_standard_storage(struct bNode *node)
Definition: node_util.c:43
void node_socket_set_vector(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, const float *value)
void node_socket_get_color(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, float *value)
void node_vector_math_label(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
struct bNodeExecContext bNodeExecContext
float node_socket_get_float(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
void node_copy_curves(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node)
void node_socket_set_float(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, float value)
void node_socket_set_color(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, const float *value)
struct bNodeInstanceHash * previews