Fix T43335: Node Editor: name doesn't update
authorjulianeisel <julian_eisel@web.de>
Sun, 25 Jan 2015 00:59:49 +0000 (01:59 +0100)
committerjulianeisel <julian_eisel@web.de>
Sun, 25 Jan 2015 00:59:49 +0000 (01:59 +0100)
Update Node Editor info (drawn on the bottom left) on redraw if needed

source/blender/editors/space_node/node_draw.c
source/blender/makesdna/DNA_space_types.h

index 16ad63bcafa2feec9d6a1e33b186dcc72fd26df3..0de231ba7ccc1f4a3e4f4f662e95b078a98e870e 100644 (file)
@@ -1302,8 +1302,15 @@ void drawnodespace(const bContext *C, ARegion *ar)
                bNodeLinkDrag *nldrag;
                LinkData *linkdata;
                
+               BLI_assert(snode->id != NULL);
+               
                path = snode->treepath.last;
                
+               /* update tree path name (drawn in the bottom left) */
+               if (UNLIKELY(!STREQ(path->node_name, snode->id->name + 2))) {
+                       BLI_strncpy(path->node_name, snode->id->name + 2, sizeof(path->node_name));
+               }
+               
                /* current View2D center, will be set temporarily for parent node trees */
                UI_view2d_center_get(v2d, &center[0], &center[1]);
                
index 4a73ff39a6e93dd47ff0d5cc1cdd0b51f11b150c..d32fb58f6db22164545877674be7a81b34f9e4cc 100644 (file)
@@ -934,7 +934,7 @@ typedef struct bNodeTreePath {
        bNodeInstanceKey parent_key;    /* base key for nodes in this tree instance */
        int pad;
        float view_center[2];                   /* v2d center point, so node trees can have different offsets in editors */
-       /* XXX this is not automatically updated when node names are changed! */
+       
        char node_name[64];             /* MAX_NAME */
 } bNodeTreePath;