Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2009-11-11 12:11:21 +0300
committerMatt Ebb <matt@mke3.net>2009-11-11 12:11:21 +0300
commitc0fae59c99fdcb802b055c81d51ece6cf9ce5518 (patch)
treee6bb9f3a302e3e222a4fc84b2c1ca746946a9199 /source/blender/editors/space_node/node_draw.c
parentb2bb9ca39a687efc5dd1014e78650e39452d7cbf (diff)
* Fixed nodetree animation by giving nodes unique names
Now the rna path to nodes happens via the node name, which is ensured to be unique via RNA. As part of this, the node->username string has been removed, upon renaming the node itself it takes care of making sure it's unique (like bones, constraints, etc). There's currently no interactive rename tool, but you can do it via the datablocks editor. - plus a few notifier tweaks, using the newer NC_NODE notifier to refresh graph editor etc.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 4ac6fbebea1..1cdad0b746c 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -719,12 +719,14 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
else
UI_ThemeColor(TH_TEXT);
- if(node->flag & NODE_MUTED)
- sprintf(showname, "[%s]", node->name);
- else if(node->username[0])
- sprintf(showname, "(%s) %s", node->username, node->name);
+ if(node->flag & NODE_CUSTOM_NAME)
+ BLI_strncpy(showname, node->name, 32);
else
- BLI_strncpy(showname, node->name, 128);
+ /* todo: auto name display for node types */
+ BLI_strncpy(showname, node->name, 32);
+
+ //if(node->flag & NODE_MUTED)
+ // sprintf(showname, "[%s]", showname);
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(rct->ymax-NODE_DY),
(int)(iconofs - rct->xmin-18.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
@@ -878,12 +880,15 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
if(node->miniwidth>0.0f) {
- if(node->flag & NODE_MUTED)
- sprintf(showname, "[%s]", node->name);
- else if(node->username[0])
- sprintf(showname, "(%s)%s", node->username, node->name);
+
+ if(node->flag & NODE_CUSTOM_NAME)
+ BLI_strncpy(showname, node->name, 128);
else
+ /* todo: auto name display */
BLI_strncpy(showname, node->name, 128);
+
+ //if(node->flag & NODE_MUTED)
+ // sprintf(showname, "[%s]", showname);
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(centy-10),
(int)(rct->xmax - rct->xmin-18.0f -12.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
@@ -1021,12 +1026,8 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* backdrop title */
UI_ThemeColor(TH_TEXT_HI);
- if(gnode->username[0]) {
- strcpy(showname,"(");
- strcat(showname, gnode->username);
- strcat(showname,") ");
- strcat(showname, ngroup->id.name+2);
- }
+ if (gnode->flag & NODE_CUSTOM_NAME)
+ strcat(showname, gnode->name);
else
strcpy(showname, ngroup->id.name+2);