diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-19 16:39:27 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-06 20:28:23 +0300 |
commit | 9bd2e9104a05cd95c8397204cbc11e5943064b9d (patch) | |
tree | 2d920397c51d4e297e074d221a0ec9b5e46434e2 /source/blender/editors | |
parent | 046904e3fc6d5a9b10215d97ffc71f08bce37a41 (diff) |
Nodes: show node labels (like image name) in material properties node view.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 173c919e38c..fcfde6f87bf 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -386,20 +386,13 @@ static void ui_node_link(bContext *C, void *arg_p, void *event_p) ED_undo_push(C, "Node input modify"); } -static void ui_node_sock_name(bNodeSocket *sock, char name[UI_MAX_NAME_STR]) +static void ui_node_sock_name(bNodeTree *ntree, bNodeSocket *sock, char name[UI_MAX_NAME_STR]) { if (sock->link && sock->link->fromnode) { bNode *node = sock->link->fromnode; char node_name[UI_MAX_NAME_STR]; - if (node->type == NODE_GROUP) { - if (node->id) - BLI_strncpy(node_name, node->id->name + 2, UI_MAX_NAME_STR); - else - BLI_strncpy(node_name, N_(node->typeinfo->ui_name), UI_MAX_NAME_STR); - } - else - BLI_strncpy(node_name, node->typeinfo->ui_name, UI_MAX_NAME_STR); + nodeLabel(ntree, node, node_name, sizeof(node_name)); if (BLI_listbase_is_empty(&node->inputs) && node->outputs.first != node->outputs.last) @@ -612,7 +605,7 @@ void uiTemplateNodeLink(uiLayout *layout, bNodeTree *ntree, bNode *node, bNodeSo if (sock->link || sock->type == SOCK_SHADER || (sock->flag & SOCK_HIDE_VALUE)) { char name[UI_MAX_NAME_STR]; - ui_node_sock_name(sock, name); + ui_node_sock_name(ntree, sock, name); but = uiDefMenuBut(block, ui_template_node_link_menu, NULL, name, 0, 0, UI_UNIT_X * 4, UI_UNIT_Y, ""); } else |