Blender  V3.3
BKE_node.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
4 #pragma once
5 
10 #include "BLI_compiler_compat.h"
11 #include "BLI_ghash.h"
12 
13 #include "DNA_listBase.h"
14 
15 /* for FOREACH_NODETREE_BEGIN */
16 #include "DNA_node_types.h"
17 
18 #include "RNA_types.h"
19 
20 #ifdef __cplusplus
21 # include "BLI_map.hh"
22 # include "BLI_string_ref.hh"
23 #endif
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /* not very important, but the stack solver likes to know a maximum */
30 #define MAX_SOCKET 512
31 
32 struct ARegion;
33 struct BlendDataReader;
34 struct BlendExpander;
35 struct BlendLibReader;
36 struct BlendWriter;
39 struct CryptomatteSession;
40 struct FreestyleLineStyle;
41 struct GPUMaterial;
42 struct GPUNodeStack;
43 struct ID;
44 struct ImBuf;
45 struct ImageFormatData;
46 struct Light;
47 struct ListBase;
48 struct MTex;
49 struct Main;
50 struct Material;
51 struct PointerRNA;
52 struct RenderData;
53 struct Scene;
54 struct SpaceNode;
55 struct Tex;
56 struct World;
57 struct bContext;
58 struct bNode;
59 struct bNodeExecContext;
60 struct bNodeExecData;
61 struct bNodeInstanceHash;
62 struct bNodeLink;
63 struct bNodeSocket;
64 struct bNodeStack;
65 struct bNodeTree;
66 struct bNodeTreeExec;
67 struct bNodeTreeType;
68 struct uiLayout;
69 
70 /* -------------------------------------------------------------------- */
84 typedef struct bNodeSocketTemplate {
85  int type;
86  char name[64]; /* MAX_NAME */
87  float val1, val2, val3, val4; /* default alloc value for inputs */
88  float min, max;
89  int subtype; /* would use PropertySubType but this is a bad level include to use RNA */
90  int flag;
91 
92  /* after this line is used internal only */
93  struct bNodeSocket *sock; /* used to hold verified socket */
94  char identifier[64]; /* generated from name */
96 
97 /* Use `void *` for callbacks that require C++. This is rather ugly, but works well for now. This
98  * would not be necessary if we would use bNodeSocketType and bNodeType only in C++ code.
99  * However, achieving this requires quite a few changes currently. */
100 #ifdef __cplusplus
101 namespace blender {
102 class CPPType;
103 namespace nodes {
104 class NodeMultiFunctionBuilder;
105 class GeoNodeExecParams;
106 class NodeDeclarationBuilder;
107 class GatherLinkSearchOpParams;
108 } // namespace nodes
109 namespace fn {
110 class MFDataType;
111 } // namespace fn
112 } // namespace blender
113 
118 using SocketGetCPPValueFunction = void (*)(const struct bNodeSocket &socket, void *r_value);
119 using SocketGetGeometryNodesCPPValueFunction = void (*)(const struct bNodeSocket &socket,
120  void *r_value);
121 
122 /* Adds socket link operations that are specific to this node type. */
125 
126 #else
129 typedef void *NodeDeclareFunction;
135 typedef struct CPPTypeHandle CPPTypeHandle;
136 #endif
137 
143 typedef struct bNodeSocketType {
144  /* Identifier name */
145  char idname[64];
146  /* Type label */
147  char label[64];
148 
149  void (*draw)(struct bContext *C,
150  struct uiLayout *layout,
151  struct PointerRNA *ptr,
152  struct PointerRNA *node_ptr,
153  const char *text);
154  void (*draw_color)(struct bContext *C,
155  struct PointerRNA *ptr,
156  struct PointerRNA *node_ptr,
157  float *r_color);
158 
159  void (*interface_draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr);
160  void (*interface_draw_color)(struct bContext *C, struct PointerRNA *ptr, float *r_color);
162  struct bNodeSocket *interface_socket,
163  struct StructRNA *data_srna);
165  const struct bNodeSocket *interface_socket,
166  struct bNode *node,
167  struct bNodeSocket *sock,
168  const char *data_path);
170  const struct bNodeSocket *interface_socket,
171  struct bNode *node,
172  struct bNodeSocket *sock,
173  const char *data_path);
175  struct bNodeSocket *interface_socket,
176  struct bNode *node,
177  struct bNodeSocket *sock);
178 
179  /* RNA integration */
182 
183  /* for standard socket types in C */
184  int type, subtype;
185 
186  /* When set, bNodeSocket->limit does not have any effect anymore. */
190 
191  /* Callback to free the socket type. */
192  void (*free_self)(struct bNodeSocketType *stype);
193 
194  /* Return the CPPType of this socket. */
196  /* Get the value of this socket in a generic way. */
198  /* Get geometry nodes cpp type. */
200  /* Get geometry nodes cpp value. */
203 
204 typedef void *(*NodeInitExecFunction)(struct bNodeExecContext *context,
205  struct bNode *node,
206  bNodeInstanceKey key);
207 typedef void (*NodeFreeExecFunction)(void *nodedata);
208 typedef void (*NodeExecFunction)(void *data,
209  int thread,
210  struct bNode *,
211  struct bNodeExecData *execdata,
212  struct bNodeStack **in,
213  struct bNodeStack **out);
214 typedef int (*NodeGPUExecFunction)(struct GPUMaterial *mat,
215  struct bNode *node,
216  struct bNodeExecData *execdata,
217  struct GPUNodeStack *in,
218  struct GPUNodeStack *out);
219 
226 typedef struct bNodeType {
227  char idname[64]; /* identifier name */
228  int type;
229 
230  char ui_name[64]; /* MAX_NAME */
231  char ui_description[256];
232  int ui_icon;
233 
236  short nclass, flag;
237 
238  /* templates for static sockets */
240 
241  char storagename[64]; /* struct name for DNA */
242 
243  /* Draw the option buttons on the node */
244  void (*draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr);
245  /* Additional parameters in the side panel */
246  void (*draw_buttons_ex)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr);
247 
248  /* Additional drawing on backdrop */
250  struct SpaceNode *snode, struct ImBuf *backdrop, struct bNode *node, int x, int y);
251 
256  void (*labelfunc)(const struct bNodeTree *ntree,
257  const struct bNode *node,
258  char *label,
259  int maxlen);
260 
262  int (*ui_class)(const struct bNode *node);
263 
265  void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node);
268 
270  void (*initfunc)(struct bNodeTree *ntree, struct bNode *node);
272  void (*freefunc)(struct bNode *node);
274  void (*copyfunc)(struct bNodeTree *dest_ntree,
275  struct bNode *dest_node,
276  const struct bNode *src_node);
277 
278  /* Registerable API callback versions, called in addition to C callbacks */
279  void (*initfunc_api)(const struct bContext *C, struct PointerRNA *ptr);
281  void (*copyfunc_api)(struct PointerRNA *ptr, const struct bNode *src_node);
282 
292  bool (*poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint);
297  struct bNodeTree *nodetree,
298  const char **r_disabled_hint);
299 
300  /* optional handling of link insertion */
301  void (*insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link);
302 
303  void (*free_self)(struct bNodeType *ntype);
304 
305  /* **** execution callbacks **** */
309  /* gpu */
311 
312  /* Build a multi-function for this node. */
314 
315  /* Execute a geometry node. */
322 
323  /* Declares which sockets the node has. */
325  /* Different nodes of this type can have different declarations. */
327  /* Declaration to be used when it is not dynamic. */
329 
336 
338  bool no_muting;
339 
340  /* RNA integration */
343 
344 /* nodetype->nclass, for add-menu and themes */
345 #define NODE_CLASS_INPUT 0
346 #define NODE_CLASS_OUTPUT 1
347 #define NODE_CLASS_OP_COLOR 3
348 #define NODE_CLASS_OP_VECTOR 4
349 #define NODE_CLASS_OP_FILTER 5
350 #define NODE_CLASS_GROUP 6
351 #define NODE_CLASS_CONVERTER 8
352 #define NODE_CLASS_MATTE 9
353 #define NODE_CLASS_DISTORT 10
354 #define NODE_CLASS_PATTERN 12
355 #define NODE_CLASS_TEXTURE 13
356 #define NODE_CLASS_SCRIPT 32
357 #define NODE_CLASS_INTERFACE 33
358 #define NODE_CLASS_SHADER 40
359 #define NODE_CLASS_GEOMETRY 41
360 #define NODE_CLASS_ATTRIBUTE 42
361 #define NODE_CLASS_LAYOUT 100
362 
363 typedef enum eNodeSizePreset {
369 
370 struct bNodeTreeExec;
371 
372 typedef void (*bNodeClassCallback)(void *calldata, int nclass, const char *name);
373 typedef struct bNodeTreeType {
374  int type; /* type identifier */
375  char idname[64]; /* identifier name */
376 
377  char ui_name[64];
378  char ui_description[256];
379  int ui_icon;
380 
381  /* callbacks */
384  /* Iteration over all node classes. */
385  void (*foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func);
386  /* Check visibility in the node editor */
387  bool (*poll)(const struct bContext *C, struct bNodeTreeType *ntreetype);
388  /* Select a node tree from the context */
389  void (*get_from_context)(const struct bContext *C,
390  struct bNodeTreeType *ntreetype,
391  struct bNodeTree **r_ntree,
392  struct ID **r_id,
393  struct ID **r_from);
394 
395  /* calls allowing threaded composite */
396  void (*localize)(struct bNodeTree *localtree, struct bNodeTree *ntree);
397  void (*local_merge)(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree);
398 
399  /* Tree update. Overrides `nodetype->updatetreefunc` ! */
400  void (*update)(struct bNodeTree *ntree);
401 
403 
404  void (*node_add_init)(struct bNodeTree *ntree, struct bNode *bnode);
405 
406  /* Check if the socket type is valid for this tree type. */
407  bool (*valid_socket_type)(struct bNodeTreeType *ntreetype, struct bNodeSocketType *socket_type);
408 
409  /* RNA integration */
412 
415 /* -------------------------------------------------------------------- */
419 struct bNodeTreeType *ntreeTypeFind(const char *idname);
420 void ntreeTypeAdd(struct bNodeTreeType *nt);
421 void ntreeTypeFreeLink(const struct bNodeTreeType *nt);
422 bool ntreeIsRegistered(struct bNodeTree *ntree);
423 struct GHashIterator *ntreeTypeGetIterator(void);
424 
425 /* Helper macros for iterating over tree types. */
426 #define NODE_TREE_TYPES_BEGIN(ntype) \
427  { \
428  GHashIterator *__node_tree_type_iter__ = ntreeTypeGetIterator(); \
429  for (; !BLI_ghashIterator_done(__node_tree_type_iter__); \
430  BLI_ghashIterator_step(__node_tree_type_iter__)) { \
431  bNodeTreeType *ntype = (bNodeTreeType *)BLI_ghashIterator_getValue(__node_tree_type_iter__);
432 
433 #define NODE_TREE_TYPES_END \
434  } \
435  BLI_ghashIterator_free(__node_tree_type_iter__); \
436  } \
437  (void)0
438 
447 void ntreeSetTypes(const struct bContext *C, struct bNodeTree *ntree);
448 
449 struct bNodeTree *ntreeAddTree(struct Main *bmain, const char *name, const char *idname);
450 
451 /* copy/free funcs, need to manage ID users */
452 
457 void ntreeFreeTree(struct bNodeTree *ntree);
463  struct Main *bmain,
464  bool do_id_user);
465 struct bNodeTree *ntreeCopyTree(struct Main *bmain, const struct bNodeTree *ntree);
466 
473 struct bNodeTree **BKE_ntree_ptr_from_id(struct ID *id);
477 struct bNodeTree *ntreeFromID(struct ID *id);
478 
479 void ntreeFreeLocalNode(struct bNodeTree *ntree, struct bNode *node);
480 void ntreeFreeLocalTree(struct bNodeTree *ntree);
481 struct bNode *ntreeFindType(const struct bNodeTree *ntree, int type);
482 bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup);
483 void ntreeUpdateAllNew(struct Main *main);
484 void ntreeUpdateAllUsers(struct Main *main, struct ID *id);
485 
487  struct bNode ***r_deplist,
488  int *r_deplist_len);
490 
496 void ntreeSetOutput(struct bNodeTree *ntree);
497 
498 void ntreeFreeCache(struct bNodeTree *ntree);
499 
500 void ntreeNodeFlagSet(const bNodeTree *ntree, int flag, bool enable);
504 struct bNodeTree *ntreeLocalize(struct bNodeTree *ntree);
510 void ntreeLocalMerge(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree);
511 
515 void ntreeBlendWrite(struct BlendWriter *writer, struct bNodeTree *ntree);
519 void ntreeBlendReadData(struct BlendDataReader *reader, struct bNodeTree *ntree);
520 void ntreeBlendReadLib(struct BlendLibReader *reader, struct bNodeTree *ntree);
521 void ntreeBlendReadExpand(struct BlendExpander *expander, struct bNodeTree *ntree);
522 
525 /* -------------------------------------------------------------------- */
531  const char *identifier);
534  const char *idname,
535  const char *name);
538  const char *idname,
539  struct bNodeSocket *next_sock,
540  const char *name);
542  struct bNode *from_node,
543  struct bNodeSocket *from_sock);
545  struct bNodeSocket *next_sock,
546  struct bNode *from_node,
547  struct bNodeSocket *from_sock);
548 void ntreeRemoveSocketInterface(struct bNodeTree *ntree, struct bNodeSocket *sock);
549 
550 struct StructRNA *ntreeInterfaceTypeGet(struct bNodeTree *ntree, bool create);
553 
556 /* -------------------------------------------------------------------- */
560 struct bNodeType *nodeTypeFind(const char *idname);
561 void nodeRegisterType(struct bNodeType *ntype);
562 void nodeUnregisterType(struct bNodeType *ntype);
563 bool nodeTypeUndefined(const struct bNode *node);
564 struct GHashIterator *nodeTypeGetIterator(void);
565 
566 /* Helper macros for iterating over node types. */
567 #define NODE_TYPES_BEGIN(ntype) \
568  { \
569  GHashIterator *__node_type_iter__ = nodeTypeGetIterator(); \
570  for (; !BLI_ghashIterator_done(__node_type_iter__); \
571  BLI_ghashIterator_step(__node_type_iter__)) { \
572  bNodeType *ntype = (bNodeType *)BLI_ghashIterator_getValue(__node_type_iter__);
573 
574 #define NODE_TYPES_END \
575  } \
576  BLI_ghashIterator_free(__node_type_iter__); \
577  } \
578  ((void)0)
579 
580 struct bNodeSocketType *nodeSocketTypeFind(const char *idname);
581 void nodeRegisterSocketType(struct bNodeSocketType *stype);
582 void nodeUnregisterSocketType(struct bNodeSocketType *stype);
583 bool nodeSocketIsRegistered(struct bNodeSocket *sock);
585 const char *nodeSocketTypeLabel(const bNodeSocketType *stype);
586 
587 bool nodeIsStaticSocketType(const struct bNodeSocketType *stype);
588 const char *nodeStaticSocketType(int type, int subtype);
589 const char *nodeStaticSocketInterfaceType(int type, int subtype);
590 const char *nodeStaticSocketLabel(int type, int subtype);
591 
592 /* Helper macros for iterating over node types. */
593 #define NODE_SOCKET_TYPES_BEGIN(stype) \
594  { \
595  GHashIterator *__node_socket_type_iter__ = nodeSocketTypeGetIterator(); \
596  for (; !BLI_ghashIterator_done(__node_socket_type_iter__); \
597  BLI_ghashIterator_step(__node_socket_type_iter__)) { \
598  bNodeSocketType *stype = (bNodeSocketType *)BLI_ghashIterator_getValue( \
599  __node_socket_type_iter__);
600 
601 #define NODE_SOCKET_TYPES_END \
602  } \
603  BLI_ghashIterator_free(__node_socket_type_iter__); \
604  } \
605  ((void)0)
606 
607 struct bNodeSocket *nodeFindSocket(const struct bNode *node,
609  const char *identifier);
610 struct bNodeSocket *nodeAddSocket(struct bNodeTree *ntree,
611  struct bNode *node,
613  const char *idname,
614  const char *identifier,
615  const char *name);
617  struct bNode *node,
619  int type,
620  int subtype,
621  const char *identifier,
622  const char *name);
623 void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock);
624 void nodeRemoveSocketEx(struct bNodeTree *ntree,
625  struct bNode *node,
626  struct bNodeSocket *sock,
627  bool do_id_user);
628 void nodeRemoveAllSockets(struct bNodeTree *ntree, struct bNode *node);
630  struct bNode *node,
631  struct bNodeSocket *sock,
632  const char *idname);
634  struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, int type, int subtype);
635 
636 struct bNode *nodeAddNode(const struct bContext *C, struct bNodeTree *ntree, const char *idname);
637 struct bNode *nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type);
641 void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
645 void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
646 
650 void nodeRemoveNode(struct Main *bmain,
651  struct bNodeTree *ntree,
652  struct bNode *node,
653  bool do_id_user);
654 
655 #ifdef __cplusplus
656 
657 namespace blender::bke {
658 
665  const bNode &node_src,
666  int flag,
667  bool unique_name,
668  Map<const bNodeSocket *, bNodeSocket *> &new_socket_map);
669 
670 bNode *node_copy(bNodeTree *dst_tree, const bNode &src_node, int flag, bool unique_name);
671 
672 } // namespace blender::bke
673 
674 #endif
675 
679 struct bNodeLink *nodeAddLink(struct bNodeTree *ntree,
680  struct bNode *fromnode,
681  struct bNodeSocket *fromsock,
682  struct bNode *tonode,
683  struct bNodeSocket *tosock);
684 void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link);
685 void nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
686 void nodeMuteLinkToggle(struct bNodeTree *ntree, struct bNodeLink *link);
687 bool nodeLinkIsHidden(const struct bNodeLink *link);
688 bool nodeLinkIsSelected(const struct bNodeLink *link);
689 void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node);
690 
691 void nodeToView(const struct bNode *node, float x, float y, float *rx, float *ry);
692 void nodeFromView(const struct bNode *node, float x, float y, float *rx, float *ry);
693 bool nodeAttachNodeCheck(const struct bNode *node, const struct bNode *parent);
694 void nodeAttachNode(struct bNode *node, struct bNode *parent);
695 void nodeDetachNode(struct bNode *node);
696 
697 void nodePositionRelative(struct bNode *from_node,
698  struct bNode *to_node,
699  struct bNodeSocket *from_sock,
700  struct bNodeSocket *to_sock);
701 void nodePositionPropagate(struct bNode *node);
702 
706 struct bNode *nodeFindNodebyName(struct bNodeTree *ntree, const char *name);
710 bool nodeFindNode(struct bNodeTree *ntree,
711  struct bNodeSocket *sock,
712  struct bNode **r_node,
713  int *r_sockindex);
718 
723 bool nodeIsChildOf(const bNode *parent, const bNode *child);
724 
732 void nodeChainIter(const bNodeTree *ntree,
733  const bNode *node_start,
734  bool (*callback)(bNode *, bNode *, void *, const bool),
735  void *userdata,
736  bool reversed);
749  const bNode *node_start,
750  bool (*callback)(bNode *, bNode *, void *),
751  void *userdata,
752  int recursion_lvl);
759 void nodeParentsIter(bNode *node, bool (*callback)(bNode *, void *), void *userdata);
760 
762  const struct bNodeSocket *from,
763  const struct bNodeSocket *to);
764 int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock);
765 
766 void nodeSetSelected(struct bNode *node, bool select);
770 void nodeSetActive(struct bNodeTree *ntree, struct bNode *node);
771 struct bNode *nodeGetActive(struct bNodeTree *ntree);
772 void nodeClearActive(struct bNodeTree *ntree);
776 struct bNode *nodeGetActiveTexture(struct bNodeTree *ntree);
778 
784 bool nodeSupportsActiveFlag(const struct bNode *node, int sub_active);
785 
786 int nodeSocketIsHidden(const struct bNodeSocket *sock);
788  struct bNodeSocket *sock,
789  bool is_available);
790 
791 int nodeSocketLinkLimit(const struct bNodeSocket *sock);
792 
797 bool nodeDeclarationEnsure(struct bNodeTree *ntree, struct bNode *node);
808 
812 void BKE_node_clipboard_init(const struct bNodeTree *ntree);
813 void BKE_node_clipboard_clear(void);
814 void BKE_node_clipboard_free(void);
818 bool BKE_node_clipboard_validate(void);
820 void BKE_node_clipboard_add_link(struct bNodeLink *link);
821 const struct ListBase *BKE_node_clipboard_get_nodes(void);
822 const struct ListBase *BKE_node_clipboard_get_links(void);
824 
828 typedef struct bNodeInstanceHash {
832 
833 typedef void (*bNodeInstanceValueFP)(void *value);
834 
840 
842  const struct bNodeTree *ntree,
843  const struct bNode *node);
844 
850  bNodeInstanceKey key,
851  bNodeInstanceValueFP valfreefp);
856 
861  bNodeInstanceValueFP valfreefp);
862 
864 
866 {
867  return BLI_ghashIterator_new(hash->ghash);
868 }
871 {
872  BLI_ghashIterator_init(iter, hash->ghash);
873 }
875 {
877 }
880 {
882 }
884 {
885  return BLI_ghashIterator_getValue(iter);
886 }
888 {
890 }
892 {
893  return BLI_ghashIterator_done(iter);
894 }
895 
896 #define NODE_INSTANCE_HASH_ITER(iter_, hash_) \
897  for (BKE_node_instance_hash_iterator_init(&iter_, hash_); \
898  BKE_node_instance_hash_iterator_done(&iter_) == false; \
899  BKE_node_instance_hash_iterator_step(&iter_))
900 
901 /* Node Previews */
902 
903 bool BKE_node_preview_used(const struct bNode *node);
905  struct bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, bool create);
908 void BKE_node_preview_init_tree(struct bNodeTree *ntree, int xsize, int ysize);
912 
913 void BKE_node_preview_merge_tree(struct bNodeTree *to_ntree,
914  struct bNodeTree *from_ntree,
915  bool remove_old);
916 
919 /* -------------------------------------------------------------------- */
923 void nodeLabel(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen);
927 const char *nodeSocketLabel(const struct bNodeSocket *sock);
928 
929 bool nodeGroupPoll(struct bNodeTree *nodetree,
930  struct bNodeTree *grouptree,
931  const char **r_disabled_hint);
932 
936 void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
937 void node_type_base_custom(struct bNodeType *ntype,
938  const char *idname,
939  const char *name,
940  short nclass);
941 void node_type_socket_templates(struct bNodeType *ntype,
942  struct bNodeSocketTemplate *inputs,
943  struct bNodeSocketTemplate *outputs);
944 void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth);
946 void node_type_init(struct bNodeType *ntype,
947  void (*initfunc)(struct bNodeTree *ntree, struct bNode *node));
952 void node_type_storage(struct bNodeType *ntype,
953  const char *storagename,
954  void (*freefunc)(struct bNode *node),
955  void (*copyfunc)(struct bNodeTree *dest_ntree,
956  struct bNode *dest_node,
957  const struct bNode *src_node));
958 void node_type_update(struct bNodeType *ntype,
959  void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node));
960 void node_type_group_update(struct bNodeType *ntype,
961  void (*group_update_func)(struct bNodeTree *ntree,
962  struct bNode *node));
963 
964 void node_type_exec(struct bNodeType *ntype,
965  NodeInitExecFunction init_exec_fn,
966  NodeFreeExecFunction free_exec_fn,
967  NodeExecFunction exec_fn);
968 void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn);
969 
972 /* -------------------------------------------------------------------- */
977 
978 /* ************** COMMON NODES *************** */
979 
980 #define NODE_UNDEFINED -2 /* node type is not registered */
981 #define NODE_CUSTOM -1 /* for dynamically registered custom types */
982 #define NODE_GROUP 2
983 // #define NODE_FORLOOP 3 /* deprecated */
984 // #define NODE_WHILELOOP 4 /* deprecated */
985 #define NODE_FRAME 5
986 #define NODE_REROUTE 6
987 #define NODE_GROUP_INPUT 7
988 #define NODE_GROUP_OUTPUT 8
989 #define NODE_CUSTOM_GROUP 9
990 
991 void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree);
992 
995 /* -------------------------------------------------------------------- */
1031 /* should be an opaque type, only for internal use by BKE_node_tree_iter_*** */
1035  struct Material *mat;
1037  struct Light *light;
1038  struct World *world;
1041 };
1042 
1043 void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain);
1044 bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
1045  struct bNodeTree **r_nodetree,
1046  struct ID **r_id);
1047 
1048 #define FOREACH_NODETREE_BEGIN(bmain, _nodetree, _id) \
1049  { \
1050  struct NodeTreeIterStore _nstore; \
1051  bNodeTree *_nodetree; \
1052  ID *_id; \
1053  /* avoid compiler warning about unused variables */ \
1054  BKE_node_tree_iter_init(&_nstore, bmain); \
1055  while (BKE_node_tree_iter_step(&_nstore, &_nodetree, &_id) == true) { \
1056  if (_nodetree) {
1057 
1058 #define FOREACH_NODETREE_END \
1059  } \
1060  } \
1061  } \
1062  ((void)0)
1063 
1066 /* -------------------------------------------------------------------- */
1070 void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, int layer_index);
1071 
1072 /* -------------------------------------------------------------------- */
1076 /* NOTE: types are needed to restore callbacks, don't change values. */
1077 
1078 //#define SH_NODE_MATERIAL 100
1079 #define SH_NODE_RGB 101
1080 #define SH_NODE_VALUE 102
1081 #define SH_NODE_MIX_RGB 103
1082 #define SH_NODE_VALTORGB 104
1083 #define SH_NODE_RGBTOBW 105
1084 #define SH_NODE_SHADERTORGB 106
1085 //#define SH_NODE_TEXTURE 106
1086 #define SH_NODE_NORMAL 107
1087 //#define SH_NODE_GEOMETRY 108
1088 #define SH_NODE_MAPPING 109
1089 #define SH_NODE_CURVE_VEC 110
1090 #define SH_NODE_CURVE_RGB 111
1091 #define SH_NODE_CAMERA 114
1092 #define SH_NODE_MATH 115
1093 #define SH_NODE_VECTOR_MATH 116
1094 #define SH_NODE_SQUEEZE 117
1095 //#define SH_NODE_MATERIAL_EXT 118
1096 #define SH_NODE_INVERT 119
1097 #define SH_NODE_SEPRGB_LEGACY 120
1098 #define SH_NODE_COMBRGB_LEGACY 121
1099 #define SH_NODE_HUE_SAT 122
1100 
1101 #define SH_NODE_OUTPUT_MATERIAL 124
1102 #define SH_NODE_OUTPUT_WORLD 125
1103 #define SH_NODE_OUTPUT_LIGHT 126
1104 #define SH_NODE_FRESNEL 127
1105 #define SH_NODE_MIX_SHADER 128
1106 #define SH_NODE_ATTRIBUTE 129
1107 #define SH_NODE_BACKGROUND 130
1108 #define SH_NODE_BSDF_ANISOTROPIC 131
1109 #define SH_NODE_BSDF_DIFFUSE 132
1110 #define SH_NODE_BSDF_GLOSSY 133
1111 #define SH_NODE_BSDF_GLASS 134
1112 #define SH_NODE_BSDF_TRANSLUCENT 137
1113 #define SH_NODE_BSDF_TRANSPARENT 138
1114 #define SH_NODE_BSDF_VELVET 139
1115 #define SH_NODE_EMISSION 140
1116 #define SH_NODE_NEW_GEOMETRY 141
1117 #define SH_NODE_LIGHT_PATH 142
1118 #define SH_NODE_TEX_IMAGE 143
1119 #define SH_NODE_TEX_SKY 145
1120 #define SH_NODE_TEX_GRADIENT 146
1121 #define SH_NODE_TEX_VORONOI 147
1122 #define SH_NODE_TEX_MAGIC 148
1123 #define SH_NODE_TEX_WAVE 149
1124 #define SH_NODE_TEX_NOISE 150
1125 #define SH_NODE_TEX_MUSGRAVE 152
1126 #define SH_NODE_TEX_COORD 155
1127 #define SH_NODE_ADD_SHADER 156
1128 #define SH_NODE_TEX_ENVIRONMENT 157
1129 // #define SH_NODE_OUTPUT_TEXTURE 158
1130 #define SH_NODE_HOLDOUT 159
1131 #define SH_NODE_LAYER_WEIGHT 160
1132 #define SH_NODE_VOLUME_ABSORPTION 161
1133 #define SH_NODE_VOLUME_SCATTER 162
1134 #define SH_NODE_GAMMA 163
1135 #define SH_NODE_TEX_CHECKER 164
1136 #define SH_NODE_BRIGHTCONTRAST 165
1137 #define SH_NODE_LIGHT_FALLOFF 166
1138 #define SH_NODE_OBJECT_INFO 167
1139 #define SH_NODE_PARTICLE_INFO 168
1140 #define SH_NODE_TEX_BRICK 169
1141 #define SH_NODE_BUMP 170
1142 #define SH_NODE_SCRIPT 171
1143 #define SH_NODE_AMBIENT_OCCLUSION 172
1144 #define SH_NODE_BSDF_REFRACTION 173
1145 #define SH_NODE_TANGENT 174
1146 #define SH_NODE_NORMAL_MAP 175
1147 #define SH_NODE_HAIR_INFO 176
1148 #define SH_NODE_SUBSURFACE_SCATTERING 177
1149 #define SH_NODE_WIREFRAME 178
1150 #define SH_NODE_BSDF_TOON 179
1151 #define SH_NODE_WAVELENGTH 180
1152 #define SH_NODE_BLACKBODY 181
1153 #define SH_NODE_VECT_TRANSFORM 182
1154 #define SH_NODE_SEPHSV_LEGACY 183
1155 #define SH_NODE_COMBHSV_LEGACY 184
1156 #define SH_NODE_BSDF_HAIR 185
1157 // #define SH_NODE_LAMP 186
1158 #define SH_NODE_UVMAP 187
1159 #define SH_NODE_SEPXYZ 188
1160 #define SH_NODE_COMBXYZ 189
1161 #define SH_NODE_OUTPUT_LINESTYLE 190
1162 #define SH_NODE_UVALONGSTROKE 191
1163 #define SH_NODE_TEX_POINTDENSITY 192
1164 #define SH_NODE_BSDF_PRINCIPLED 193
1165 #define SH_NODE_TEX_IES 194
1166 #define SH_NODE_EEVEE_SPECULAR 195
1167 #define SH_NODE_BEVEL 197
1168 #define SH_NODE_DISPLACEMENT 198
1169 #define SH_NODE_VECTOR_DISPLACEMENT 199
1170 #define SH_NODE_VOLUME_PRINCIPLED 200
1171 /* 201..700 occupied by other node types, continue from 701 */
1172 #define SH_NODE_BSDF_HAIR_PRINCIPLED 701
1173 #define SH_NODE_MAP_RANGE 702
1174 #define SH_NODE_CLAMP 703
1175 #define SH_NODE_TEX_WHITE_NOISE 704
1176 #define SH_NODE_VOLUME_INFO 705
1177 #define SH_NODE_VERTEX_COLOR 706
1178 #define SH_NODE_OUTPUT_AOV 707
1179 #define SH_NODE_VECTOR_ROTATE 708
1180 #define SH_NODE_CURVE_FLOAT 709
1181 #define SH_NODE_POINT_INFO 710
1182 #define SH_NODE_COMBINE_COLOR 711
1183 #define SH_NODE_SEPARATE_COLOR 712
1184 
1187 /* -------------------------------------------------------------------- */
1191 /* output socket defines */
1192 #define RRES_OUT_IMAGE 0
1193 #define RRES_OUT_ALPHA 1
1194 
1195 /* NOTE: types are needed to restore callbacks, don't change values. */
1196 #define CMP_NODE_VIEWER 201
1197 #define CMP_NODE_RGB 202
1198 #define CMP_NODE_VALUE 203
1199 #define CMP_NODE_MIX_RGB 204
1200 #define CMP_NODE_VALTORGB 205
1201 #define CMP_NODE_RGBTOBW 206
1202 #define CMP_NODE_NORMAL 207
1203 #define CMP_NODE_CURVE_VEC 208
1204 #define CMP_NODE_CURVE_RGB 209
1205 #define CMP_NODE_ALPHAOVER 210
1206 #define CMP_NODE_BLUR 211
1207 #define CMP_NODE_FILTER 212
1208 #define CMP_NODE_MAP_VALUE 213
1209 #define CMP_NODE_TIME 214
1210 #define CMP_NODE_VECBLUR 215
1211 #define CMP_NODE_SEPRGBA_LEGACY 216
1212 #define CMP_NODE_SEPHSVA_LEGACY 217
1213 #define CMP_NODE_SETALPHA 218
1214 #define CMP_NODE_HUE_SAT 219
1215 #define CMP_NODE_IMAGE 220
1216 #define CMP_NODE_R_LAYERS 221
1217 #define CMP_NODE_COMPOSITE 222
1218 #define CMP_NODE_OUTPUT_FILE 223
1219 #define CMP_NODE_TEXTURE 224
1220 #define CMP_NODE_TRANSLATE 225
1221 #define CMP_NODE_ZCOMBINE 226
1222 #define CMP_NODE_COMBRGBA_LEGACY 227
1223 #define CMP_NODE_DILATEERODE 228
1224 #define CMP_NODE_ROTATE 229
1225 #define CMP_NODE_SCALE 230
1226 #define CMP_NODE_SEPYCCA_LEGACY 231
1227 #define CMP_NODE_COMBYCCA_LEGACY 232
1228 #define CMP_NODE_SEPYUVA_LEGACY 233
1229 #define CMP_NODE_COMBYUVA_LEGACY 234
1230 #define CMP_NODE_DIFF_MATTE 235
1231 #define CMP_NODE_COLOR_SPILL 236
1232 #define CMP_NODE_CHROMA_MATTE 237
1233 #define CMP_NODE_CHANNEL_MATTE 238
1234 #define CMP_NODE_FLIP 239
1235 #define CMP_NODE_SPLITVIEWER 240
1236 // #define CMP_NODE_INDEX_MASK 241
1237 #define CMP_NODE_MAP_UV 242
1238 #define CMP_NODE_ID_MASK 243
1239 #define CMP_NODE_DEFOCUS 244
1240 #define CMP_NODE_DISPLACE 245
1241 #define CMP_NODE_COMBHSVA_LEGACY 246
1242 #define CMP_NODE_MATH 247
1243 #define CMP_NODE_LUMA_MATTE 248
1244 #define CMP_NODE_BRIGHTCONTRAST 249
1245 #define CMP_NODE_GAMMA 250
1246 #define CMP_NODE_INVERT 251
1247 #define CMP_NODE_NORMALIZE 252
1248 #define CMP_NODE_CROP 253
1249 #define CMP_NODE_DBLUR 254
1250 #define CMP_NODE_BILATERALBLUR 255
1251 #define CMP_NODE_PREMULKEY 256
1252 #define CMP_NODE_DIST_MATTE 257
1253 #define CMP_NODE_VIEW_LEVELS 258
1254 #define CMP_NODE_COLOR_MATTE 259
1255 #define CMP_NODE_COLORBALANCE 260
1256 #define CMP_NODE_HUECORRECT 261
1257 #define CMP_NODE_MOVIECLIP 262
1258 #define CMP_NODE_STABILIZE2D 263
1259 #define CMP_NODE_TRANSFORM 264
1260 #define CMP_NODE_MOVIEDISTORTION 265
1261 #define CMP_NODE_DOUBLEEDGEMASK 266
1262 #define CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED \
1263  267 /* DEPRECATED multi file node has been merged into regular CMP_NODE_OUTPUT_FILE */
1264 #define CMP_NODE_MASK 268
1265 #define CMP_NODE_KEYINGSCREEN 269
1266 #define CMP_NODE_KEYING 270
1267 #define CMP_NODE_TRACKPOS 271
1268 #define CMP_NODE_INPAINT 272
1269 #define CMP_NODE_DESPECKLE 273
1270 #define CMP_NODE_ANTIALIASING 274
1271 
1272 #define CMP_NODE_GLARE 301
1273 #define CMP_NODE_TONEMAP 302
1274 #define CMP_NODE_LENSDIST 303
1275 #define CMP_NODE_SUNBEAMS 304
1276 
1277 #define CMP_NODE_COLORCORRECTION 312
1278 #define CMP_NODE_MASK_BOX 313
1279 #define CMP_NODE_MASK_ELLIPSE 314
1280 #define CMP_NODE_BOKEHIMAGE 315
1281 #define CMP_NODE_BOKEHBLUR 316
1282 #define CMP_NODE_SWITCH 317
1283 #define CMP_NODE_PIXELATE 318
1284 
1285 #define CMP_NODE_MAP_RANGE 319
1286 #define CMP_NODE_PLANETRACKDEFORM 320
1287 #define CMP_NODE_CORNERPIN 321
1288 #define CMP_NODE_SWITCH_VIEW 322
1289 #define CMP_NODE_CRYPTOMATTE_LEGACY 323
1290 #define CMP_NODE_DENOISE 324
1291 #define CMP_NODE_EXPOSURE 325
1292 #define CMP_NODE_CRYPTOMATTE 326
1293 #define CMP_NODE_POSTERIZE 327
1294 #define CMP_NODE_CONVERT_COLOR_SPACE 328
1295 #define CMP_NODE_SCENE_TIME 329
1296 #define CMP_NODE_SEPARATE_XYZ 330
1297 #define CMP_NODE_COMBINE_XYZ 331
1298 #define CMP_NODE_COMBINE_COLOR 332
1299 #define CMP_NODE_SEPARATE_COLOR 333
1300 
1301 /* channel toggles */
1302 #define CMP_CHAN_RGB 1
1303 #define CMP_CHAN_A 2
1304 
1305 /* filter types */
1306 #define CMP_FILT_SOFT 0
1307 #define CMP_FILT_SHARP_BOX 1
1308 #define CMP_FILT_LAPLACE 2
1309 #define CMP_FILT_SOBEL 3
1310 #define CMP_FILT_PREWITT 4
1311 #define CMP_FILT_KIRSCH 5
1312 #define CMP_FILT_SHADOW 6
1313 #define CMP_FILT_SHARP_DIAMOND 7
1314 
1315 /* scale node type, in custom1 */
1316 #define CMP_SCALE_RELATIVE 0
1317 #define CMP_SCALE_ABSOLUTE 1
1318 #define CMP_SCALE_SCENEPERCENT 2
1319 #define CMP_SCALE_RENDERPERCENT 3
1320 /* custom2 */
1321 #define CMP_SCALE_RENDERSIZE_FRAME_ASPECT (1 << 0)
1322 #define CMP_SCALE_RENDERSIZE_FRAME_CROP (1 << 1)
1323 
1324 /* track position node, in custom1 */
1325 #define CMP_TRACKPOS_ABSOLUTE 0
1326 #define CMP_TRACKPOS_RELATIVE_START 1
1327 #define CMP_TRACKPOS_RELATIVE_FRAME 2
1328 #define CMP_TRACKPOS_ABSOLUTE_FRAME 3
1329 
1330 /* Cryptomatte source. */
1331 #define CMP_CRYPTOMATTE_SRC_RENDER 0
1332 #define CMP_CRYPTOMATTE_SRC_IMAGE 1
1333 
1334 /* Default SMAA configuration values. */
1335 #define CMP_DEFAULT_SMAA_THRESHOLD 1.0f
1336 #define CMP_DEFAULT_SMAA_CONTRAST_LIMIT 0.2f
1337 #define CMP_DEFAULT_SMAA_CORNER_ROUNDING 0.25f
1338 
1341 /* -------------------------------------------------------------------- */
1345 struct TexResult;
1346 
1347 #define TEX_NODE_OUTPUT 401
1348 #define TEX_NODE_CHECKER 402
1349 #define TEX_NODE_TEXTURE 403
1350 #define TEX_NODE_BRICKS 404
1351 #define TEX_NODE_MATH 405
1352 #define TEX_NODE_MIX_RGB 406
1353 #define TEX_NODE_RGBTOBW 407
1354 #define TEX_NODE_VALTORGB 408
1355 #define TEX_NODE_IMAGE 409
1356 #define TEX_NODE_CURVE_RGB 410
1357 #define TEX_NODE_INVERT 411
1358 #define TEX_NODE_HUE_SAT 412
1359 #define TEX_NODE_CURVE_TIME 413
1360 #define TEX_NODE_ROTATE 414
1361 #define TEX_NODE_VIEWER 415
1362 #define TEX_NODE_TRANSLATE 416
1363 #define TEX_NODE_COORD 417
1364 #define TEX_NODE_DISTANCE 418
1365 #define TEX_NODE_COMPOSE_LEGACY 419
1366 #define TEX_NODE_DECOMPOSE_LEGACY 420
1367 #define TEX_NODE_VALTONOR 421
1368 #define TEX_NODE_SCALE 422
1369 #define TEX_NODE_AT 423
1370 #define TEX_NODE_COMBINE_COLOR 424
1371 #define TEX_NODE_SEPARATE_COLOR 425
1372 
1373 /* 501-599 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */
1374 #define TEX_NODE_PROC 500
1375 #define TEX_NODE_PROC_MAX 600
1376 
1379 /* -------------------------------------------------------------------- */
1383 #define GEO_NODE_TRIANGULATE 1000
1384 #define GEO_NODE_TRANSFORM 1002
1385 #define GEO_NODE_MESH_BOOLEAN 1003
1386 #define GEO_NODE_OBJECT_INFO 1007
1387 #define GEO_NODE_JOIN_GEOMETRY 1010
1388 #define GEO_NODE_COLLECTION_INFO 1023
1389 #define GEO_NODE_IS_VIEWPORT 1024
1390 #define GEO_NODE_SUBDIVIDE_MESH 1029
1391 #define GEO_NODE_MESH_PRIMITIVE_CUBE 1032
1392 #define GEO_NODE_MESH_PRIMITIVE_CIRCLE 1033
1393 #define GEO_NODE_MESH_PRIMITIVE_UV_SPHERE 1034
1394 #define GEO_NODE_MESH_PRIMITIVE_CYLINDER 1035
1395 #define GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE 1036
1396 #define GEO_NODE_MESH_PRIMITIVE_CONE 1037
1397 #define GEO_NODE_MESH_PRIMITIVE_LINE 1038
1398 #define GEO_NODE_MESH_PRIMITIVE_GRID 1039
1399 #define GEO_NODE_BOUNDING_BOX 1042
1400 #define GEO_NODE_SWITCH 1043
1401 #define GEO_NODE_CURVE_TO_MESH 1045
1402 #define GEO_NODE_RESAMPLE_CURVE 1047
1403 #define GEO_NODE_INPUT_MATERIAL 1050
1404 #define GEO_NODE_REPLACE_MATERIAL 1051
1405 #define GEO_NODE_CURVE_LENGTH 1054
1406 #define GEO_NODE_CONVEX_HULL 1056
1407 #define GEO_NODE_SEPARATE_COMPONENTS 1059
1408 #define GEO_NODE_CURVE_PRIMITIVE_STAR 1062
1409 #define GEO_NODE_CURVE_PRIMITIVE_SPIRAL 1063
1410 #define GEO_NODE_CURVE_PRIMITIVE_QUADRATIC_BEZIER 1064
1411 #define GEO_NODE_CURVE_PRIMITIVE_BEZIER_SEGMENT 1065
1412 #define GEO_NODE_CURVE_PRIMITIVE_CIRCLE 1066
1413 #define GEO_NODE_VIEWER 1067
1414 #define GEO_NODE_CURVE_PRIMITIVE_LINE 1068
1415 #define GEO_NODE_CURVE_PRIMITIVE_QUADRILATERAL 1070
1416 #define GEO_NODE_TRIM_CURVE 1071
1417 #define GEO_NODE_FILL_CURVE 1075
1418 #define GEO_NODE_INPUT_POSITION 1076
1419 #define GEO_NODE_SET_POSITION 1077
1420 #define GEO_NODE_INPUT_INDEX 1078
1421 #define GEO_NODE_INPUT_NORMAL 1079
1422 #define GEO_NODE_CAPTURE_ATTRIBUTE 1080
1423 #define GEO_NODE_MATERIAL_SELECTION 1081
1424 #define GEO_NODE_SET_MATERIAL 1082
1425 #define GEO_NODE_REALIZE_INSTANCES 1083
1426 #define GEO_NODE_ATTRIBUTE_STATISTIC 1084
1427 #define GEO_NODE_SAMPLE_CURVE 1085
1428 #define GEO_NODE_INPUT_TANGENT 1086
1429 #define GEO_NODE_STRING_JOIN 1087
1430 #define GEO_NODE_CURVE_SPLINE_PARAMETER 1088
1431 #define GEO_NODE_FILLET_CURVE 1089
1432 #define GEO_NODE_DISTRIBUTE_POINTS_ON_FACES 1090
1433 #define GEO_NODE_STRING_TO_CURVES 1091
1434 #define GEO_NODE_INSTANCE_ON_POINTS 1092
1435 #define GEO_NODE_MESH_TO_POINTS 1093
1436 #define GEO_NODE_POINTS_TO_VERTICES 1094
1437 #define GEO_NODE_REVERSE_CURVE 1095
1438 #define GEO_NODE_PROXIMITY 1096
1439 #define GEO_NODE_SUBDIVIDE_CURVE 1097
1440 #define GEO_NODE_INPUT_SPLINE_LENGTH 1098
1441 #define GEO_NODE_CURVE_SPLINE_TYPE 1099
1442 #define GEO_NODE_CURVE_SET_HANDLE_TYPE 1100
1443 #define GEO_NODE_POINTS_TO_VOLUME 1101
1444 #define GEO_NODE_CURVE_HANDLE_TYPE_SELECTION 1102
1445 #define GEO_NODE_DELETE_GEOMETRY 1103
1446 #define GEO_NODE_SEPARATE_GEOMETRY 1104
1447 #define GEO_NODE_INPUT_RADIUS 1105
1448 #define GEO_NODE_INPUT_CURVE_TILT 1106
1449 #define GEO_NODE_INPUT_CURVE_HANDLES 1107
1450 #define GEO_NODE_INPUT_SHADE_SMOOTH 1108
1451 #define GEO_NODE_INPUT_SPLINE_RESOLUTION 1109
1452 #define GEO_NODE_INPUT_SPLINE_CYCLIC 1110
1453 #define GEO_NODE_SET_CURVE_RADIUS 1111
1454 #define GEO_NODE_SET_CURVE_TILT 1112
1455 #define GEO_NODE_SET_CURVE_HANDLES 1113
1456 #define GEO_NODE_SET_SHADE_SMOOTH 1114
1457 #define GEO_NODE_SET_SPLINE_RESOLUTION 1115
1458 #define GEO_NODE_SET_SPLINE_CYCLIC 1116
1459 #define GEO_NODE_SET_POINT_RADIUS 1117
1460 #define GEO_NODE_INPUT_MATERIAL_INDEX 1118
1461 #define GEO_NODE_SET_MATERIAL_INDEX 1119
1462 #define GEO_NODE_TRANSLATE_INSTANCES 1120
1463 #define GEO_NODE_SCALE_INSTANCES 1121
1464 #define GEO_NODE_ROTATE_INSTANCES 1122
1465 #define GEO_NODE_SPLIT_EDGES 1123
1466 #define GEO_NODE_MESH_TO_CURVE 1124
1467 #define GEO_NODE_TRANSFER_ATTRIBUTE 1125
1468 #define GEO_NODE_SUBDIVISION_SURFACE 1126
1469 #define GEO_NODE_CURVE_ENDPOINT_SELECTION 1127
1470 #define GEO_NODE_RAYCAST 1128
1471 #define GEO_NODE_CURVE_TO_POINTS 1130
1472 #define GEO_NODE_INSTANCES_TO_POINTS 1131
1473 #define GEO_NODE_IMAGE_TEXTURE 1132
1474 #define GEO_NODE_VOLUME_TO_MESH 1133
1475 #define GEO_NODE_INPUT_ID 1134
1476 #define GEO_NODE_SET_ID 1135
1477 #define GEO_NODE_ATTRIBUTE_DOMAIN_SIZE 1136
1478 #define GEO_NODE_DUAL_MESH 1137
1479 #define GEO_NODE_INPUT_MESH_EDGE_VERTICES 1138
1480 #define GEO_NODE_INPUT_MESH_FACE_AREA 1139
1481 #define GEO_NODE_INPUT_MESH_FACE_NEIGHBORS 1140
1482 #define GEO_NODE_INPUT_MESH_VERTEX_NEIGHBORS 1141
1483 #define GEO_NODE_GEOMETRY_TO_INSTANCE 1142
1484 #define GEO_NODE_INPUT_MESH_EDGE_NEIGHBORS 1143
1485 #define GEO_NODE_INPUT_MESH_ISLAND 1144
1486 #define GEO_NODE_INPUT_SCENE_TIME 1145
1487 #define GEO_NODE_ACCUMULATE_FIELD 1146
1488 #define GEO_NODE_INPUT_MESH_EDGE_ANGLE 1147
1489 #define GEO_NODE_FIELD_AT_INDEX 1148
1490 #define GEO_NODE_CURVE_PRIMITIVE_ARC 1149
1491 #define GEO_NODE_FLIP_FACES 1150
1492 #define GEO_NODE_SCALE_ELEMENTS 1151
1493 #define GEO_NODE_EXTRUDE_MESH 1152
1494 #define GEO_NODE_MERGE_BY_DISTANCE 1153
1495 #define GEO_NODE_DUPLICATE_ELEMENTS 1154
1496 #define GEO_NODE_INPUT_MESH_FACE_IS_PLANAR 1155
1497 #define GEO_NODE_STORE_NAMED_ATTRIBUTE 1156
1498 #define GEO_NODE_INPUT_NAMED_ATTRIBUTE 1157
1499 #define GEO_NODE_REMOVE_ATTRIBUTE 1158
1500 #define GEO_NODE_INPUT_INSTANCE_ROTATION 1159
1501 #define GEO_NODE_INPUT_INSTANCE_SCALE 1160
1502 #define GEO_NODE_VOLUME_CUBE 1161
1503 #define GEO_NODE_POINTS 1162
1504 #define GEO_NODE_INTERPOLATE_DOMAIN 1163
1505 #define GEO_NODE_MESH_TO_VOLUME 1164
1506 #define GEO_NODE_UV_UNWRAP 1165
1507 #define GEO_NODE_UV_PACK_ISLANDS 1166
1508 #define GEO_NODE_DEFORM_CURVES_ON_SURFACE 1167
1509 #define GEO_NODE_INPUT_SHORTEST_EDGE_PATHS 1168
1510 #define GEO_NODE_EDGE_PATHS_TO_CURVES 1169
1511 #define GEO_NODE_EDGE_PATHS_TO_SELECTION 1170
1512 
1515 /* -------------------------------------------------------------------- */
1519 #define FN_NODE_BOOLEAN_MATH 1200
1520 #define FN_NODE_COMPARE 1202
1521 #define FN_NODE_LEGACY_RANDOM_FLOAT 1206
1522 #define FN_NODE_INPUT_VECTOR 1207
1523 #define FN_NODE_INPUT_STRING 1208
1524 #define FN_NODE_FLOAT_TO_INT 1209
1525 #define FN_NODE_VALUE_TO_STRING 1210
1526 #define FN_NODE_STRING_LENGTH 1211
1527 #define FN_NODE_SLICE_STRING 1212
1528 #define FN_NODE_INPUT_SPECIAL_CHARACTERS 1213
1529 #define FN_NODE_RANDOM_VALUE 1214
1530 #define FN_NODE_ROTATE_EULER 1215
1531 #define FN_NODE_ALIGN_EULER_TO_VECTOR 1216
1532 #define FN_NODE_INPUT_COLOR 1217
1533 #define FN_NODE_REPLACE_STRING 1218
1534 #define FN_NODE_INPUT_BOOL 1219
1535 #define FN_NODE_INPUT_INT 1220
1536 #define FN_NODE_SEPARATE_COLOR 1221
1537 #define FN_NODE_COMBINE_COLOR 1222
1538 
1541 void BKE_node_system_init(void);
1542 void BKE_node_system_exit(void);
1543 
1544 extern struct bNodeType NodeTypeUndefined;
1546 
1547 #ifdef __cplusplus
1548 }
1549 #endif
1550 
1551 #ifdef __cplusplus
1552 
1553 namespace blender::bke {
1554 
1558 
1559 } // namespace blender::bke
1560 
1561 #endif
1562 
1563 #define NODE_STORAGE_FUNCS(StorageT) \
1564  [[maybe_unused]] static StorageT &node_storage(bNode &node) \
1565  { \
1566  return *static_cast<StorageT *>(node.storage); \
1567  } \
1568  [[maybe_unused]] static const StorageT &node_storage(const bNode &node) \
1569  { \
1570  return *static_cast<const StorageT *>(node.storage); \
1571  }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
void nodeFromView(const struct bNode *node, float x, float y, float *rx, float *ry)
void ntreeTypeAdd(struct bNodeTreeType *nt)
Definition: node.cc:1292
void BKE_node_clipboard_init(const struct bNodeTree *ntree)
Definition: node.cc:3773
void *(* NodeInitExecFunction)(struct bNodeExecContext *context, struct bNode *node, bNodeInstanceKey key)
Definition: BKE_node.h:204
void nodeUniqueName(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:2127
void nodeRemoveSocketEx(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, bool do_id_user)
Definition: node.cc:1938
void * SocketGetGeometryNodesCPPTypeFunction
Definition: BKE_node.h:132
struct bNodeLink * nodeFindLink(struct bNodeTree *ntree, const struct bNodeSocket *from, const struct bNodeSocket *to)
struct bNodeTree * ntreeLocalize(struct bNodeTree *ntree)
Definition: node.cc:3249
const char * nodeSocketTypeLabel(const bNodeSocketType *stype)
Definition: node.cc:1443
BLI_INLINE void BKE_node_instance_hash_iterator_free(bNodeInstanceHashIterator *iter)
Definition: BKE_node.h:874
const struct ListBase * BKE_node_clipboard_get_links(void)
Definition: node.cc:3878
void * NodeDeclareFunction
Definition: BKE_node.h:129
struct bNodeTree * ntreeFromID(struct ID *id)
Definition: node.cc:3231
bNodePreview * BKE_node_preview_verify(struct bNodeInstanceHash *previews, bNodeInstanceKey key, int xsize, int ysize, bool create)
Definition: node.cc:2721
void BKE_node_preview_free(struct bNodePreview *preview)
Definition: node.cc:2771
struct GHashIterator * nodeSocketTypeGetIterator(void)
Definition: node.cc:1438
void BKE_node_clipboard_add_node(struct bNode *node)
Definition: node.cc:3838
void nodeRegisterSocketType(struct bNodeSocketType *stype)
Definition: node.cc:1419
void node_type_base_custom(struct bNodeType *ntype, const char *idname, const char *name, short nclass)
Definition: node.cc:4311
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
bool nodeLinkIsHidden(const struct bNodeLink *link)
void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree, struct Scene *scene, int layer_index)
Definition: node.cc:5067
struct bNodeSocket * ntreeInsertSocketInterfaceFromSocket(struct bNodeTree *ntree, struct bNodeSocket *next_sock, struct bNode *from_node, struct bNodeSocket *from_sock)
Definition: node.cc:3396
bool nodeAttachNodeCheck(const struct bNode *node, const struct bNode *parent)
bNodeInstanceHash * BKE_node_instance_hash_new(const char *info)
Definition: node.cc:3943
struct bNodeSocket * nodeAddSocket(struct bNodeTree *ntree, struct bNode *node, eNodeSocketInOut in_out, const char *idname, const char *identifier, const char *name)
Definition: node.cc:1679
void BKE_node_tree_unlink_id(ID *id, struct bNodeTree *ntree)
Definition: node_common.cc:417
void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:2490
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4358
struct bNode * ntreeFindType(const struct bNodeTree *ntree, int type)
bool nodeGroupPoll(struct bNodeTree *nodetree, struct bNodeTree *grouptree, const char **r_disabled_hint)
Definition: node_common.cc:85
void BKE_node_preview_init_tree(struct bNodeTree *ntree, int xsize, int ysize)
Definition: node.cc:2801
void ntreeBlendWrite(struct BlendWriter *writer, struct bNodeTree *ntree)
Definition: node.cc:519
void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Definition: node.cc:4277
const bNodeInstanceKey NODE_INSTANCE_KEY_BASE
Definition: node.cc:3896
void nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock)
Definition: node.cc:2455
void ntreeBlendReadData(struct BlendDataReader *reader, struct bNodeTree *ntree)
Definition: node.cc:675
struct CPPTypeHandle CPPTypeHandle
Definition: BKE_node.h:135
BLI_INLINE bNodeInstanceKey BKE_node_instance_hash_iterator_get_key(bNodeInstanceHashIterator *iter)
Definition: BKE_node.h:879
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4443
struct bNodeTreeType * ntreeTypeFind(const char *idname)
Definition: node.cc:1280
void * NodeGeometryExecFunction
Definition: BKE_node.h:128
void BKE_node_preview_clear_tree(struct bNodeTree *ntree)
Definition: node.cc:2852
struct bNodeType NodeTypeUndefined
Definition: node.cc:111
void nodeModifySocketType(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, const char *idname)
bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup)
void ntreeBlendReadLib(struct BlendLibReader *reader, struct bNodeTree *ntree)
Definition: node.cc:900
bool nodeIsChildOf(const bNode *parent, const bNode *child)
Definition: node.cc:2028
void ntreeFreeLocalNode(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:2998
void BKE_node_instance_hash_insert(bNodeInstanceHash *hash, bNodeInstanceKey key, void *value)
Definition: node.cc:3957
void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain)
Definition: node.cc:5002
struct StructRNA * ntreeInterfaceTypeGet(struct bNodeTree *ntree, bool create)
Definition: node.cc:3495
void BKE_node_preview_remove_unused(struct bNodeTree *ntree)
Definition: node.cc:2831
bNodePreview * BKE_node_preview_copy(struct bNodePreview *preview)
Definition: node.cc:2762
void(* bNodeInstanceValueFP)(void *value)
Definition: BKE_node.h:833
void(* bNodeClassCallback)(void *calldata, int nclass, const char *name)
Definition: BKE_node.h:372
const struct ListBase * BKE_node_clipboard_get_nodes(void)
Definition: node.cc:3873
void ntreeUpdateNodeLevels(struct bNodeTree *ntree)
Definition: node.cc:4122
BLI_INLINE void * BKE_node_instance_hash_iterator_get_value(bNodeInstanceHashIterator *iter)
Definition: BKE_node.h:883
void(* NodeExecFunction)(void *data, int thread, struct bNode *, struct bNodeExecData *execdata, struct bNodeStack **in, struct bNodeStack **out)
Definition: BKE_node.h:208
bool nodeTypeUndefined(const struct bNode *node)
void ntreeFreeCache(struct bNodeTree *ntree)
Definition: node.cc:3130
struct bNodeSocketType bNodeSocketType
Defines a socket type.
BLI_INLINE void BKE_node_instance_hash_iterator_init(bNodeInstanceHashIterator *iter, bNodeInstanceHash *hash)
Definition: BKE_node.h:869
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
Definition: node.cc:3664
struct GHashIterator * ntreeTypeGetIterator(void)
Definition: node.cc:1322
void ntreeRemoveSocketInterface(struct bNodeTree *ntree, struct bNodeSocket *sock)
Definition: node.cc:3415
void(* NodeFreeExecFunction)(void *nodedata)
Definition: BKE_node.h:207
void nodePositionPropagate(struct bNode *node)
Definition: node.cc:2663
void ntreeFreeTree(struct bNodeTree *ntree)
Definition: node.cc:3106
void nodeAttachNode(struct bNode *node, struct bNode *parent)
Definition: node.cc:2594
struct bNode * nodeFindNodebyName(struct bNodeTree *ntree, const char *name)
Definition: node.cc:1992
void ntreeInterfaceTypeFree(struct bNodeTree *ntree)
Definition: node.cc:3529
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
int BKE_node_instance_hash_remove(bNodeInstanceHash *hash, bNodeInstanceKey key, bNodeInstanceValueFP valfreefp)
Definition: node.cc:3970
void * SocketGetCPPValueFunction
Definition: BKE_node.h:134
void nodeRemoveAllSockets(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:1967
struct bNode * nodeGetActive(struct bNodeTree *ntree)
Definition: node.cc:3601
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
Definition: node.cc:2338
void * SocketGetGeometryNodesCPPValueFunction
Definition: BKE_node.h:133
int nodeSocketIsHidden(const struct bNodeSocket *sock)
BLI_INLINE bool BKE_node_instance_hash_iterator_done(bNodeInstanceHashIterator *iter)
Definition: BKE_node.h:891
void BKE_node_system_exit(void)
Definition: node.cc:4957
void nodeSocketDeclarationsUpdate(struct bNode *node)
Definition: node.cc:3703
struct bNodeSocket * nodeAddStaticSocket(struct bNodeTree *ntree, struct bNode *node, eNodeSocketInOut in_out, int type, int subtype, const char *identifier, const char *name)
Definition: node.cc:1897
bool nodeSupportsActiveFlag(const struct bNode *node, int sub_active)
Does the given node supports the sub active flag.
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
Definition: node.cc:4408
struct bNodeSocket * ntreeAddSocketInterfaceFromSocket(struct bNodeTree *ntree, struct bNode *from_node, struct bNodeSocket *from_sock)
Definition: node.cc:3382
void nodeRemoveNode(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool do_id_user)
Definition: node.cc:3011
int BKE_node_clipboard_get_type(void)
Definition: node.cc:3883
void nodeMuteLinkToggle(struct bNodeTree *ntree, struct bNodeLink *link)
Definition: node.cc:2432
void * BKE_node_instance_hash_pop(bNodeInstanceHash *hash, bNodeInstanceKey key)
Definition: node.cc:3982
int BKE_node_instance_hash_haskey(bNodeInstanceHash *hash, bNodeInstanceKey key)
Definition: node.cc:3987
void BKE_node_clipboard_add_link(struct bNodeLink *link)
Definition: node.cc:3868
struct bNodeType bNodeType
Defines a node type.
void ntreeInterfaceTypeUpdate(struct bNodeTree *ntree)
Definition: node.cc:3537
struct bNodeTree * ntreeCopyTree_ex(const struct bNodeTree *ntree, struct Main *bmain, bool do_id_user)
bool BKE_node_preview_used(const struct bNode *node)
struct bNodeTreeType bNodeTreeType
void nodeModifySocketTypeStatic(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock, int type, int subtype)
Definition: node.cc:1666
bool BKE_node_is_connected_to_output(struct bNodeTree *ntree, struct bNode *node)
Definition: node_common.cc:405
bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter, struct bNodeTree **r_nodetree, struct ID **r_id)
Definition: node.cc:5013
int nodeSocketLinkLimit(const struct bNodeSocket *sock)
bool BKE_node_instance_hash_tag_key(bNodeInstanceHash *hash, bNodeInstanceKey key)
Definition: node.cc:4015
void BKE_node_preview_merge_tree(struct bNodeTree *to_ntree, struct bNodeTree *from_ntree, bool remove_old)
Definition: node.cc:2865
struct bNode * nodeGetActivePaintCanvas(struct bNodeTree *ntree)
void BKE_node_instance_hash_clear(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
Definition: node.cc:3977
const char * nodeStaticSocketLabel(int type, int subtype)
void nodePositionRelative(struct bNode *from_node, struct bNode *to_node, struct bNodeSocket *from_sock, struct bNodeSocket *to_sock)
Definition: node.cc:2621
BLI_INLINE void BKE_node_instance_hash_iterator_step(bNodeInstanceHashIterator *iter)
Definition: BKE_node.h:887
void node_type_group_update(struct bNodeType *ntype, void(*group_update_func)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4449
void ntreeFreeEmbeddedTree(struct bNodeTree *ntree)
Definition: node.cc:3112
const char * nodeStaticSocketType(int type, int subtype)
Definition: node.cc:1710
struct bNodeSocketTemplate bNodeSocketTemplate
Compact definition of a node socket.
struct bNodeType * nodeTypeFind(const char *idname)
Definition: node.cc:1327
void ntreeNodeFlagSet(const bNodeTree *ntree, int flag, bool enable)
Definition: node.cc:3237
bool nodeIsStaticSocketType(const struct bNodeSocketType *stype)
Definition: node.cc:1701
bool nodeSocketIsRegistered(struct bNodeSocket *sock)
Definition: node.cc:1433
void ntreeSetOutput(struct bNodeTree *ntree)
Definition: node.cc:3141
void BKE_node_system_init(void)
Definition: node.cc:4930
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:4426
const char * nodeStaticSocketInterfaceType(int type, int subtype)
Definition: node.cc:1787
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
Definition: node.cc:2296
int(* NodeGPUExecFunction)(struct GPUMaterial *mat, struct bNode *node, struct bNodeExecData *execdata, struct GPUNodeStack *in, struct GPUNodeStack *out)
Definition: BKE_node.h:214
void nodeClearActive(struct bNodeTree *ntree)
Definition: node.cc:3633
void nodeParentsIter(bNode *node, bool(*callback)(bNode *, void *), void *userdata)
Definition: node.cc:2115
void nodeRemoveSocket(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocket *sock)
Definition: node.cc:1933
int BKE_node_instance_hash_size(bNodeInstanceHash *hash)
Definition: node.cc:3992
void BKE_node_preview_clear(struct bNodePreview *preview)
Definition: node.cc:2845
struct bNodeSocket * nodeFindSocket(const struct bNode *node, eNodeSocketInOut in_out, const char *identifier)
void nodeLabel(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
struct bNodeTree * ntreeCopyTree(struct Main *bmain, const struct bNodeTree *ntree)
void BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
Definition: node.cc:4028
struct bNode * nodeAddNode(const struct bContext *C, struct bNodeTree *ntree, const char *idname)
Definition: node.cc:2133
struct bNode * nodeFindRootParent(bNode *node)
Definition: node.cc:2020
void * NodeGatherSocketLinkOperationsFunction
Definition: BKE_node.h:130
void ntreeLocalMerge(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree)
Definition: node.cc:3286
void ntreeTypeFreeLink(const struct bNodeTreeType *nt)
void BKE_node_instance_hash_tag(bNodeInstanceHash *hash, void *value)
bool ntreeIsRegistered(struct bNodeTree *ntree)
Definition: node.cc:1317
void ntreeUpdateAllUsers(struct Main *main, struct ID *id)
Definition: node.cc:4202
void nodeSetSelected(struct bNode *node, bool select)
Definition: node.cc:3615
bool nodeLinkIsSelected(const struct bNodeLink *link)
struct bNodeTree ** BKE_ntree_ptr_from_id(struct ID *id)
Definition: node.cc:3209
void nodeChainIter(const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *, const bool), void *userdata, bool reversed)
Definition: node.cc:2039
struct GHashIterator * nodeTypeGetIterator(void)
Definition: node.cc:1390
struct bNode * nodeGetActiveTexture(struct bNodeTree *ntree)
struct bNodeSocket * ntreeFindSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *identifier)
Definition: node.cc:3336
struct bNodeSocketType NodeSocketTypeUndefined
Definition: node.cc:112
void ntreeBlendReadExpand(struct BlendExpander *expander, struct bNodeTree *ntree)
Definition: node.cc:996
bool nodeDeclarationEnsure(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:3731
void nodeChainIterBackwards(const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *), void *userdata, int recursion_lvl)
Definition: node.cc:2093
void ntreeFreeLocalTree(struct bNodeTree *ntree)
Definition: node.cc:3119
const bNodeInstanceKey NODE_INSTANCE_KEY_NONE
Definition: node.cc:3897
struct bNodeInstanceHash bNodeInstanceHash
bool nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock, struct bNode **r_node, int *r_sockindex)
Definition: node.cc:1997
bool nodeDeclarationEnsureOnOutdatedNode(struct bNodeTree *ntree, struct bNode *node)
struct bNodeTree * ntreeAddTree(struct Main *bmain, const char *name, const char *idname)
Definition: node.cc:2674
void nodeUnregisterSocketType(struct bNodeSocketType *stype)
Definition: node.cc:1428
struct bNodeSocket * ntreeAddSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *idname, const char *name)
Definition: node.cc:3349
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
Definition: node.cc:2151
void * SocketGetCPPTypeFunction
Definition: BKE_node.h:131
void BKE_node_instance_hash_clear_tags(bNodeInstanceHash *hash)
Definition: node.cc:3997
bool BKE_node_clipboard_validate(void)
Definition: node.cc:3795
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
void ntreeUpdateAllNew(struct Main *main)
Definition: node.cc:4173
void BKE_node_clipboard_clear(void)
Definition: node.cc:3778
void nodeToView(const struct bNode *node, float x, float y, float *rx, float *ry)
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
Definition: node.cc:4455
struct bNodeSocket * ntreeInsertSocketInterface(struct bNodeTree *ntree, eNodeSocketInOut in_out, const char *idname, struct bNodeSocket *next_sock, const char *name)
Definition: node.cc:3365
void nodeDetachNode(struct bNode *node)
Definition: node.cc:2607
void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***r_deplist, int *r_deplist_len)
Definition: node.cc:4095
void * BKE_node_instance_hash_lookup(bNodeInstanceHash *hash, bNodeInstanceKey key)
Definition: node.cc:3965
struct bNodeSocketType * nodeSocketTypeFind(const char *idname)
Definition: node.cc:1395
void ntreeSetTypes(const struct bContext *C, struct bNodeTree *ntree)
Definition: node.cc:1253
void nodeUnregisterType(struct bNodeType *ntype)
Definition: node.cc:1378
void BKE_node_instance_hash_free(bNodeInstanceHash *hash, bNodeInstanceValueFP valfreefp)
Definition: node.cc:3951
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
void nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:2903
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
Definition: node.cc:3644
GHashIterator bNodeInstanceHashIterator
Definition: BKE_node.h:863
void BKE_node_clipboard_free(void)
Definition: node.cc:3888
BLI_INLINE bNodeInstanceHashIterator * BKE_node_instance_hash_iterator_new(bNodeInstanceHash *hash)
Definition: BKE_node.h:865
const char * nodeSocketLabel(const struct bNodeSocket *sock)
eNodeSizePreset
Definition: BKE_node.h:363
@ NODE_SIZE_DEFAULT
Definition: BKE_node.h:364
@ NODE_SIZE_LARGE
Definition: BKE_node.h:367
@ NODE_SIZE_SMALL
Definition: BKE_node.h:365
@ NODE_SIZE_MIDDLE
Definition: BKE_node.h:366
bNodeInstanceKey BKE_node_instance_key(bNodeInstanceKey parent_key, const struct bNodeTree *ntree, const struct bNode *node)
void * NodeMultiFunctionBuildFunction
Definition: BKE_node.h:127
#define BLI_INLINE
BLI_INLINE void * BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:298
void BLI_ghashIterator_step(GHashIterator *ghi)
Definition: BLI_ghash.c:914
void BLI_ghashIterator_free(GHashIterator *ghi)
Definition: BLI_ghash.c:928
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:302
GHashIterator * BLI_ghashIterator_new(GHash *gh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:891
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
Definition: BLI_ghash.c:898
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:310
These structs are the foundation for all linked lists in the library system.
struct NodeDeclarationHandle NodeDeclarationHandle
eNodeSocketInOut
eNodeSocketDatatype
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
#define C
Definition: RandGen.cpp:25
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
Definition: avxb.h:154
int main(int argc, char *argv[])
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Definition: thread.h:34
OperationNode * node
StackEntry * from
const char * label
Scene scene
DEGForeachIDComponentCallback callback
SyclQueue void void size_t num_bytes void
bNodeTree * ntree
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
GAttributeReader lookup(const void *owner, const AttributeIDRef &attribute_id)
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value)
Allocate a new IDProperty of type IDP_INT, set its name and value.
bNodeSocket * node_find_enabled_socket(bNode &node, const eNodeSocketInOut in_out, const StringRef name)
Definition: node.cc:1464
bNode * node_copy_with_mapping(bNodeTree *dst_tree, const bNode &node_src, const int flag, const bool unique_name, Map< const bNodeSocket *, bNodeSocket * > &socket_map)
Definition: node.cc:2198
bNodeSocket * node_find_enabled_output_socket(bNode &node, StringRef name)
Definition: node.cc:1482
bNodeSocket * node_find_enabled_input_socket(bNode &node, StringRef name)
Definition: node.cc:1477
bNode * node_copy(bNodeTree *dst_tree, const bNode &src_node, const int flag, const bool unique_name)
Definition: node.cc:2274
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken preview("preview", pxr::TfToken::Immortal)
static bNodeSocketTemplate outputs[]
static bNodeSocketTemplate inputs[]
static void unique_name(bNode *node)
#define hash
Definition: noise.c:153
Definition: DNA_ID.h:368
Definition: BKE_main.h:121
struct Simulation * simulation
Definition: BKE_node.h:1040
struct Light * light
Definition: BKE_node.h:1037
struct World * world
Definition: BKE_node.h:1038
struct FreestyleLineStyle * linestyle
Definition: BKE_node.h:1039
struct Material * mat
Definition: BKE_node.h:1035
bNodeTree * ngroup
Definition: BKE_node.h:1033
Compact definition of a node socket.
Definition: BKE_node.h:84
struct bNodeSocket * sock
Definition: BKE_node.h:93
char identifier[64]
Definition: BKE_node.h:94
Defines a socket type.
Definition: BKE_node.h:143
SocketGetGeometryNodesCPPValueFunction get_geometry_nodes_cpp_value
Definition: BKE_node.h:201
char label[64]
Definition: BKE_node.h:147
void(* interface_from_socket)(struct bNodeTree *ntree, struct bNodeSocket *interface_socket, struct bNode *node, struct bNodeSocket *sock)
Definition: BKE_node.h:174
void(* draw_color)(struct bContext *C, struct PointerRNA *ptr, struct PointerRNA *node_ptr, float *r_color)
Definition: BKE_node.h:154
void(* interface_init_socket)(struct bNodeTree *ntree, const struct bNodeSocket *interface_socket, struct bNode *node, struct bNodeSocket *sock, const char *data_path)
Definition: BKE_node.h:164
const CPPTypeHandle * geometry_nodes_cpp_type
Definition: BKE_node.h:199
int input_link_limit
Definition: BKE_node.h:188
SocketGetCPPValueFunction get_base_cpp_value
Definition: BKE_node.h:197
ExtensionRNA ext_interface
Definition: BKE_node.h:181
ExtensionRNA ext_socket
Definition: BKE_node.h:180
void(* interface_draw_color)(struct bContext *C, struct PointerRNA *ptr, float *r_color)
Definition: BKE_node.h:160
int output_link_limit
Definition: BKE_node.h:189
void(* draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr, struct PointerRNA *node_ptr, const char *text)
Definition: BKE_node.h:149
const CPPTypeHandle * base_cpp_type
Definition: BKE_node.h:195
bool use_link_limits_of_type
Definition: BKE_node.h:187
void(* free_self)(struct bNodeSocketType *stype)
Definition: BKE_node.h:192
void(* interface_register_properties)(struct bNodeTree *ntree, struct bNodeSocket *interface_socket, struct StructRNA *data_srna)
Definition: BKE_node.h:161
void(* interface_verify_socket)(struct bNodeTree *ntree, const struct bNodeSocket *interface_socket, struct bNode *node, struct bNodeSocket *sock, const char *data_path)
Definition: BKE_node.h:169
void(* interface_draw)(struct bContext *C, struct uiLayout *layout, struct PointerRNA *ptr)
Definition: BKE_node.h:159
char idname[64]
Definition: BKE_node.h:145
char name[64]
char identifier[64]
char idname[64]
bool(* validate_link)(eNodeSocketDatatype from, eNodeSocketDatatype to)
Definition: BKE_node.h:402
bool(* poll)(const struct bContext *C, struct bNodeTreeType *ntreetype)
Definition: BKE_node.h:387
char idname[64]
Definition: BKE_node.h:375
void(* free_node_cache)(struct bNodeTree *ntree, struct bNode *node)
Definition: BKE_node.h:383
void(* update)(struct bNodeTree *ntree)
Definition: BKE_node.h:400
void(* local_merge)(struct Main *bmain, struct bNodeTree *localtree, struct bNodeTree *ntree)
Definition: BKE_node.h:397
void(* get_from_context)(const struct bContext *C, struct bNodeTreeType *ntreetype, struct bNodeTree **r_ntree, struct ID **r_id, struct ID **r_from)
Definition: BKE_node.h:389
void(* free_cache)(struct bNodeTree *ntree)
Definition: BKE_node.h:382
char ui_name[64]
Definition: BKE_node.h:377
void(* localize)(struct bNodeTree *localtree, struct bNodeTree *ntree)
Definition: BKE_node.h:396
char ui_description[256]
Definition: BKE_node.h:378
bool(* valid_socket_type)(struct bNodeTreeType *ntreetype, struct bNodeSocketType *socket_type)
Definition: BKE_node.h:407
void(* foreach_nodeclass)(struct Scene *scene, void *calldata, bNodeClassCallback func)
Definition: BKE_node.h:385
void(* node_add_init)(struct bNodeTree *ntree, struct bNode *bnode)
Definition: BKE_node.h:404
ExtensionRNA rna_ext
Definition: BKE_node.h:410
char idname[64]
Defines a node type.
Definition: BKE_node.h:226
void(* copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node)
Definition: BKE_node.h:274
NodeGeometryExecFunction geometry_node_execute
Definition: BKE_node.h:316
float minwidth
Definition: BKE_node.h:234
void(* group_update_func)(struct bNodeTree *ntree, struct bNode *node)
Definition: BKE_node.h:267
float width
Definition: BKE_node.h:234
short flag
Definition: BKE_node.h:236
char ui_name[64]
Definition: BKE_node.h:230
bool(* poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:292
float maxwidth
Definition: BKE_node.h:234
ExtensionRNA rna_ext
Definition: BKE_node.h:341
int type
Definition: BKE_node.h:228
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition: BKE_node.h:335
NodeInitExecFunction init_exec_fn
Definition: BKE_node.h:306
void(* updatefunc)(struct bNodeTree *ntree, struct bNode *node)
Definition: BKE_node.h:265
bNodeSocketTemplate * outputs
Definition: BKE_node.h:239
void(* initfunc_api)(const struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:279
void(* free_self)(struct bNodeType *ntype)
Definition: BKE_node.h:303
bool declaration_is_dynamic
Definition: BKE_node.h:326
short nclass
Definition: BKE_node.h:236
char ui_description[256]
Definition: BKE_node.h:231
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
Definition: BKE_node.h:301
bool geometry_node_execute_supports_laziness
Definition: BKE_node.h:321
void(* freefunc)(struct bNode *node)
Definition: BKE_node.h:272
NodeGPUExecFunction gpu_fn
Definition: BKE_node.h:310
void(* labelfunc)(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
Definition: BKE_node.h:256
void(* draw_buttons_ex)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:246
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeMultiFunctionBuildFunction build_multi_function
Definition: BKE_node.h:313
float minheight
Definition: BKE_node.h:235
NodeDeclareFunction declare
Definition: BKE_node.h:324
void(* freefunc_api)(struct PointerRNA *ptr)
Definition: BKE_node.h:280
float height
Definition: BKE_node.h:235
int(* ui_class)(const struct bNode *node)
Definition: BKE_node.h:262
bNodeSocketTemplate * inputs
Definition: BKE_node.h:239
bool no_muting
Definition: BKE_node.h:338
char storagename[64]
Definition: BKE_node.h:241
float maxheight
Definition: BKE_node.h:235
NodeExecFunction exec_fn
Definition: BKE_node.h:308
bool(* poll_instance)(struct bNode *node, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:296
void(* initfunc)(struct bNodeTree *ntree, struct bNode *node)
Definition: BKE_node.h:270
char idname[64]
Definition: BKE_node.h:227
void(* draw_backdrop)(struct SpaceNode *snode, struct ImBuf *backdrop, struct bNode *node, int x, int y)
Definition: BKE_node.h:249
void(* copyfunc_api)(struct PointerRNA *ptr, const struct bNode *src_node)
Definition: BKE_node.h:281
NodeFreeExecFunction free_exec_fn
Definition: BKE_node.h:307
int ui_icon
Definition: BKE_node.h:232
NodeDeclarationHandle * fixed_declaration
Definition: BKE_node.h:328
struct bNode * parent
char name[64]
char idname[64]
PointerRNA * ptr
Definition: wm_files.c:3480