43 #include "../interface/interface_intern.h"
101 for (input =
node->inputs.first; input; input = input->
next) {
118 for (input =
node->inputs.first; input; input = input->
next) {
144 for (sock =
node->inputs.first; sock; sock = sock->
next) {
168 if (!sock_to->
link) {
184 if (!sock_to->
link) {
232 node_from = node_prev;
234 else if (!node_from) {
236 if (node_prev !=
NULL) {
259 if (node_prev && node_from != node_prev) {
262 for (sock_prev = node_prev->
inputs.
first; sock_prev; sock_prev = sock_prev->
next) {
263 for (sock_from = node_from->
inputs.
first; sock_from; sock_from = sock_from->
next) {
303 #define UI_NODE_LINK_DISCONNECT -1
304 #define UI_NODE_LINK_REMOVE -2
333 const char *disabled_hint;
348 const char *disabled_hint;
357 for (stemp = lb->
first, index = 0; stemp; stemp = stemp->
next, index++, i++) {
378 for (stemp = socket_templates; stemp && stemp->
type != -1; stemp++) {
386 for (stemp = socket_templates; stemp && stemp->
type != -1; stemp++, i++) {
398 *r_totitems = totitems;
449 return (typeA == typeB);
461 if (
STREQ(ntype->
idname,
"ShaderNodeUVAlongStroke")) {
488 const char *disabled_hint;
489 if (!(ntype->poll && ntype->poll(ntype,
ntree, &disabled_hint))) {
493 if (ntype->nclass != nclass) {
514 const char *cur_node_name =
NULL;
516 int icon = ICON_NONE;
522 for (
int i = 0; i < totitems; i++) {
528 for (
int i = 0; i < totitems; i++) {
544 if (!cur_node_name || !
STREQ(cur_node_name, items[i].node_name)) {
586 TIP_(
"Add node to input"));
589 argN->
item = items[i];
629 if (ntreetype && ntreetype->foreach_nodeclass) {
654 TIP_(
"Remove nodes connected to the input"));
670 TIP_(
"Disconnect nodes connected to the input"));
712 but->
poin = (
char *)but;
735 if (
node->typeinfo->draw_buttons) {
738 node->typeinfo->draw_buttons(layout,
C, &nodeptr);
742 for (input =
node->inputs.first; input; input = input->
next) {
754 bool dependency_loop;
765 if (dependency_loop) {
779 bool add_dummy_decorator =
false;
790 ICON_DISCLOSURE_TRI_DOWN;
802 if (dependency_loop) {
804 add_dummy_decorator =
true;
809 add_dummy_decorator =
true;
825 add_dummy_decorator =
true;
831 switch (input->
type) {
842 uiItemR(sub, &inputptr,
"default_value", 0,
"", ICON_NONE);
852 uiItemR(sub, &inputptr,
"default_value", 0,
"", ICON_NONE);
859 add_dummy_decorator =
true;
864 if (add_dummy_decorator) {
struct Scene * CTX_data_scene(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void id_us_plus(struct ID *id)
#define NODE_TYPES_BEGIN(ntype)
bool nodeGroupPoll(struct bNodeTree *nodetree, struct bNodeTree *grouptree, const char **r_disabled_hint)
#define NODE_CUSTOM_GROUP
void nodeUpdate(struct bNodeTree *ntree, struct bNode *node)
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
void nodeRemoveNode(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool do_id_user)
void nodeLabel(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen)
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree)
int nodeSocketLinkLimit(const struct bNodeSocket *sock)
void nodePositionRelative(struct bNode *from_node, struct bNode *to_node, struct bNodeSocket *from_sock, struct bNodeSocket *to_sock)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
#define NODE_CLASS_LAYOUT
struct bNode * nodeAddStaticNode(const struct bContext *C, struct bNodeTree *ntree, int type)
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
#define NODE_CLASS_TEXTURE
void nodeSetActive(struct bNodeTree *ntree, struct bNode *node)
A (mainly) macro array library.
#define BLI_array_append(arr, item)
#define BLI_array_declare(arr)
#define BLI_array_len(arr)
#define BLI_array_free(arr)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define NODE_ACTIVE_TEXTURE
void ED_node_tag_update_nodetree(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node)
void ED_undo_push(struct bContext *C, const char *str)
_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
Read Guarded memory(de)allocation.
uiBut * uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float draw_color[4])
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
uiPropertySplitWrapper uiItemPropertySplitWrapperCreate(uiLayout *parent_layout)
void uiItemL(uiLayout *layout, const char *name, int icon)
void UI_but_drawflag_enable(uiBut *but, int flag)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS(uiLayout *layout)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_but_type_set_menu_from_pulldown(uiBut *but)
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
uiBut * uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, const char *tip)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
uiBut * uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, int x, int y, short width, short height, const char *tip)
void uiItemDecoratorR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int index)
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout)
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2)
void UI_block_flag_enable(uiBlock *block, int flag)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
void node_socket_color_get(bContext *C, bNodeTree *ntree, PointerRNA *node_ptr, bNodeSocket *sock, float r_color[4])
void node_geometry_add_attribute_search_button(const bContext *C, const bNodeTree *node_tree, const bNode *node, PointerRNA *socket_ptr, uiLayout *layout)
void node_socket_copy_default_value(bNodeSocket *to, const bNodeSocket *from)
static void ui_node_link(bContext *C, void *arg_p, void *event_p)
static void node_socket_add_replace(const bContext *C, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to, int type, NodeLinkItem *item)
#define UI_NODE_LINK_DISCONNECT
void uiTemplateNodeView(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
static void ui_template_node_link_menu(bContext *C, uiLayout *layout, void *but_p)
static void ui_node_sock_name(bNodeTree *ntree, bNodeSocket *sock, char name[UI_MAX_NAME_STR])
void uiTemplateNodeLink(uiLayout *layout, bContext *C, bNodeTree *ntree, bNode *node, bNodeSocket *input)
static int ui_node_item_name_compare(const void *a, const void *b)
static int ui_compatible_sockets(int typeA, int typeB)
static void ui_node_link_items(NodeLinkArg *arg, int in_out, NodeLinkItem **r_items, int *r_totitems)
static bool ui_node_item_special_poll(const bNodeTree *UNUSED(ntree), const bNodeType *ntype)
static void node_socket_remove(Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
struct NodeLinkItem NodeLinkItem
static void node_tag_recursive(bNode *node)
static void node_menu_column_foreach_cb(void *calldata, int nclass, const char *name)
static bool node_link_item_compare(bNode *node, NodeLinkItem *item)
static void node_clear_recursive(bNode *node)
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)
static void node_socket_disconnect(Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to)
static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
static void node_remove_linked(Main *bmain, bNodeTree *ntree, bNode *rem_node)
struct NodeLinkArg NodeLinkArg
#define UI_NODE_LINK_REMOVE
static void node_link_item_apply(Main *bmain, bNode *node, NodeLinkItem *item)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Compact definition of a node socket.
struct bNodeSocket * next
struct bNodeSocketType * typeinfo
struct bNodeTreeType * typeinfo
bNodeSocketTemplate * outputs
void(* draw_buttons_ex)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
bNodeSocketTemplate * inputs
struct bNodeType * typeinfo
uiLayout * decorate_column