diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-06-29 11:11:17 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-06-29 11:11:17 +0300 |
commit | 2113dbb013f3ee37207c8ec3260d037c8a29f4c8 (patch) | |
tree | 8c7c111ac028efd3f285ebe99001ea452704eb82 /source/blender/blenkernel/intern/node.c | |
parent | 10c887762a01ec2f5326b5d51a47ac77744d5ec8 (diff) | |
parent | a57a7975a1625d0876ff6ac13c14d5784236eb7e (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/editors/space_outliner/outliner_select.c
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 8ccd652edd4..82092fedbe3 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3174,12 +3174,20 @@ void nodeSynchronizeID(bNode *node, bool copy_to_id) void nodeLabel(bNodeTree *ntree, bNode *node, char *label, int maxlen) { - if (node->label[0] != '\0') + if (node->label[0] != '\0') { BLI_strncpy(label, node->label, maxlen); - else if (node->typeinfo->labelfunc) + } + else if (node->typeinfo->labelfunc) { node->typeinfo->labelfunc(ntree, node, label, maxlen); - else - BLI_strncpy(label, IFACE_(node->typeinfo->ui_name), maxlen); + } + else { + /* Kind of hacky and weak... Ideally would be better to use RNA here. :| */ + const char *tmp = CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, node->typeinfo->ui_name); + if (tmp == node->typeinfo->ui_name) { + tmp = IFACE_(node->typeinfo->ui_name); + } + BLI_strncpy(label, tmp, maxlen); + } } static void node_type_base_defaults(bNodeType *ntype) |