(Nodes) Display image name if any in the Image and Texture Image node title

This commit is contained in:
2018-01-07 22:29:25 +01:00
parent add580beee
commit 87607254d6
5 changed files with 15 additions and 2 deletions

View File

@@ -3173,13 +3173,17 @@ void nodeSynchronizeID(bNode *node, bool copy_to_id)
void nodeLabel(bNodeTree *ntree, bNode *node, char *label, int maxlen)
{
label[0] = '\0';
if (node->label[0] != '\0') {
BLI_strncpy(label, node->label, maxlen);
}
else if (node->typeinfo->labelfunc) {
node->typeinfo->labelfunc(ntree, node, label, maxlen);
}
else {
/* The previous methods (labelfunc) could not provide an adequate label for the node. */
if (label[0] == '\0') {
/* 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) {