diff options
author | Ines Almeida <britalmeida@gmail.com> | 2018-01-08 00:29:25 +0300 |
---|---|---|
committer | Ines Almeida <britalmeida@gmail.com> | 2018-01-08 00:29:25 +0300 |
commit | 87607254d6d3f9ca5ebbc696a4066bf0c8fbbed4 (patch) | |
tree | 0fd4aedc48f05c87e722250e2c00dca04cac1974 /source/blender/nodes/intern/node_util.c | |
parent | add580beeea0e1d5bd8be2336c8a5b25bc8c601a (diff) |
(Nodes) Display image name if any in the Image and Texture Image node title
Diffstat (limited to 'source/blender/nodes/intern/node_util.c')
-rw-r--r-- | source/blender/nodes/intern/node_util.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c index dd5715891d5..43d4136d556 100644 --- a/source/blender/nodes/intern/node_util.c +++ b/source/blender/nodes/intern/node_util.c @@ -91,6 +91,12 @@ void node_blend_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int ma BLI_strncpy(label, IFACE_(name), maxlen); } +void node_image_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen) +{ + /* if there is no loaded image, return an empty string, and let nodeLabel() fill in the proper type translation. */ + BLI_strncpy(label, (node->id) ? node->id->name + 2 : "", maxlen); +} + void node_math_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen) { const char *name; |