Blender  V2.93
Classes | Macros | Typedefs | Functions
node_templates.c File Reference
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "BLI_array.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
#include "RNA_access.h"
#include "NOD_socket.h"
#include "../interface/interface_intern.h"
#include "UI_interface.h"
#include "ED_node.h"
#include "node_intern.h"
#include "ED_undo.h"

Go to the source code of this file.

Classes

struct  NodeLinkItem
 
struct  NodeLinkArg
 

Macros

#define UI_NODE_LINK_DISCONNECT   -1
 
#define UI_NODE_LINK_REMOVE   -2
 

Typedefs

typedef struct NodeLinkItem NodeLinkItem
 
typedef struct NodeLinkArg NodeLinkArg
 

Functions

static bool node_link_item_compare (bNode *node, NodeLinkItem *item)
 
static void node_link_item_apply (Main *bmain, bNode *node, NodeLinkItem *item)
 
static void node_tag_recursive (bNode *node)
 
static void node_clear_recursive (bNode *node)
 
static void node_remove_linked (Main *bmain, bNodeTree *ntree, bNode *rem_node)
 
static void node_socket_disconnect (Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
 
static void node_socket_remove (Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
 
static void node_socket_add_replace (const bContext *C, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to, int type, NodeLinkItem *item)
 
static void ui_node_link_items (NodeLinkArg *arg, int in_out, NodeLinkItem **r_items, int *r_totitems)
 
static void ui_node_link (bContext *C, void *arg_p, void *event_p)
 
static void ui_node_sock_name (bNodeTree *ntree, bNodeSocket *sock, char name[UI_MAX_NAME_STR])
 
static int ui_compatible_sockets (int typeA, int typeB)
 
static int ui_node_item_name_compare (const void *a, const void *b)
 
static bool ui_node_item_special_poll (const bNodeTree *UNUSED(ntree), const bNodeType *ntype)
 
static void ui_node_menu_column (NodeLinkArg *arg, int nclass, const char *cname)
 
static void node_menu_column_foreach_cb (void *calldata, int nclass, const char *name)
 
static void ui_template_node_link_menu (bContext *C, uiLayout *layout, void *but_p)
 
void uiTemplateNodeLink (uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
 
static void ui_node_draw_input (uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input, int depth)
 
static void ui_node_draw_node (uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, int depth)
 
void uiTemplateNodeView (uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
 

Macro Definition Documentation

◆ UI_NODE_LINK_DISCONNECT

#define UI_NODE_LINK_DISCONNECT   -1

Definition at line 303 of file node_templates.c.

◆ UI_NODE_LINK_REMOVE

#define UI_NODE_LINK_REMOVE   -2

Definition at line 304 of file node_templates.c.

Typedef Documentation

◆ NodeLinkArg

typedef struct NodeLinkArg NodeLinkArg

◆ NodeLinkItem

typedef struct NodeLinkItem NodeLinkItem

Function Documentation

◆ node_clear_recursive()

static void node_clear_recursive ( bNode node)
static

Definition at line 108 of file node_templates.c.

References bNodeLink::fromnode, bNodeSocket::link, bNodeSocket::next, node, and NODE_TEST.

Referenced by node_remove_linked().

◆ node_link_item_apply()

static void node_link_item_apply ( Main bmain,
bNode node,
NodeLinkItem item 
)
static

◆ node_link_item_compare()

static bool node_link_item_compare ( bNode node,
NodeLinkItem item 
)
static

Definition at line 68 of file node_templates.c.

References ELEM, NodeLinkItem::ngroup, node, NODE_CUSTOM_GROUP, and NODE_GROUP.

Referenced by node_socket_add_replace().

◆ node_menu_column_foreach_cb()

static void node_menu_column_foreach_cb ( void *  calldata,
int  nclass,
const char *  name 
)
static

Definition at line 601 of file node_templates.c.

References ELEM, NODE_CLASS_GROUP, NODE_CLASS_LAYOUT, and ui_node_menu_column().

Referenced by ui_template_node_link_menu().

◆ node_remove_linked()

static void node_remove_linked ( Main bmain,
bNodeTree ntree,
bNode rem_node 
)
static

◆ node_socket_add_replace()

static void node_socket_add_replace ( const bContext C,
bNodeTree ntree,
bNode node_to,
bNodeSocket sock_to,
int  type,
NodeLinkItem item 
)
static

◆ node_socket_disconnect()

static void node_socket_disconnect ( Main bmain,
bNodeTree ntree,
bNode node_to,
bNodeSocket sock_to 
)
static

◆ node_socket_remove()

static void node_socket_remove ( Main bmain,
bNodeTree ntree,
bNode node_to,
bNodeSocket sock_to 
)
static

◆ node_tag_recursive()

static void node_tag_recursive ( bNode node)
static

Definition at line 91 of file node_templates.c.

References bNodeLink::fromnode, bNodeSocket::link, bNodeSocket::next, node, and NODE_TEST.

Referenced by node_remove_linked().

◆ ui_compatible_sockets()

static int ui_compatible_sockets ( int  typeA,
int  typeB 
)
static

Definition at line 447 of file node_templates.c.

Referenced by ui_node_menu_column().

◆ ui_node_draw_input()

static void ui_node_draw_input ( uiLayout layout,
bContext C,
bNodeTree ntree,
bNode node,
bNodeSocket input,
int  depth 
)
static

◆ ui_node_draw_node()

static void ui_node_draw_node ( uiLayout layout,
bContext C,
bNodeTree ntree,
bNode node,
int  depth 
)
static

◆ ui_node_item_name_compare()

static int ui_node_item_name_compare ( const void *  a,
const void *  b 
)
static

Definition at line 452 of file node_templates.c.

References Freestyle::a, BLI_strcasecmp_natural(), and bNodeType::ui_name.

Referenced by ui_node_menu_column().

◆ ui_node_item_special_poll()

static bool ui_node_item_special_poll ( const bNodeTree UNUSEDntree,
const bNodeType ntype 
)
static

Definition at line 459 of file node_templates.c.

References bNodeType::idname, and STREQ.

Referenced by ui_node_menu_column().

◆ ui_node_link()

static void ui_node_link ( bContext C,
void *  arg_p,
void *  event_p 
)
static

◆ ui_node_link_items()

static void ui_node_link_items ( NodeLinkArg arg,
int  in_out,
NodeLinkItem **  r_items,
int *  r_totitems 
)
static

◆ ui_node_menu_column()

static void ui_node_menu_column ( NodeLinkArg arg,
int  nclass,
const char *  cname 
)
static

◆ ui_node_sock_name()

static void ui_node_sock_name ( bNodeTree ntree,
bNodeSocket sock,
char  name[UI_MAX_NAME_STR] 
)
static

◆ ui_template_node_link_menu()

static void ui_template_node_link_menu ( bContext C,
uiLayout layout,
void *  but_p 
)
static

◆ uiTemplateNodeLink()

void uiTemplateNodeLink ( uiLayout layout,
bContext C,
bNodeTree ntree,
bNode node,
bNodeSocket input 
)

◆ uiTemplateNodeView()

void uiTemplateNodeView ( uiLayout layout,
bContext C,
bNodeTree ntree,
bNode node,
bNodeSocket input 
)