Fix T43335: Node Editor: name doesn't update
Update Node Editor info (drawn on the bottom left) on redraw if needed
This commit is contained in:
parent
c2af749ac3
commit
492b9ab5e3
Notes:
blender-bot
2023-02-14 19:59:45 +01:00
Referenced by issue #43335, Node Editor: name doesn't update Referenced by issue blender/blender-addons#43501, Cannot create a new custom node tree
|
@ -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, ¢er[0], ¢er[1]);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue