[Bf-blender-cvs] [492b9ab] master: Fix T43335: Node Editor: name doesn't update

julianeisel noreply at git.blender.org
Sun Jan 25 02:08:11 CET 2015


Commit: 492b9ab5e3d8b4e1c425bfae5494c998853107ea
Author: julianeisel
Date:   Sun Jan 25 01:59:49 2015 +0100
Branches: master
https://developer.blender.org/rB492b9ab5e3d8b4e1c425bfae5494c998853107ea

Fix T43335: Node Editor: name doesn't update

Update Node Editor info (drawn on the bottom left) on redraw if needed

===================================================================

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

===================================================================

diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 16ad63b..0de231b 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -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]);
 		
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 4a73ff3..d32fb58 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -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;




More information about the Bf-blender-cvs mailing list