From 7df44b9cede3aa903c4463f9e5f885a705b4173a Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 13 Jan 2010 06:35:12 +0000 Subject: Fix: wasn't able to rename node group nodetree name, or access the nodetree at all. Now you can switch between them too. Wrapped group nodes in RNA as part of this. --- source/blender/editors/space_node/drawnode.c | 45 ++-------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'source/blender/editors/space_node/drawnode.c') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 7f8bf2618a4..5c5e316663c 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -94,54 +94,13 @@ #include "node_intern.h" -/* ****************** GENERAL CALLBACKS FOR NODES ***************** */ - -#if 0 -/* XXX not used yet, make compiler happy :) */ -static void node_group_alone_cb(bContext *C, void *node_v, void *unused_v) -{ - bNode *node= node_v; - - nodeCopyGroup(node); - - // allqueue(REDRAWNODE, 0); -} /* ****************** BUTTON CALLBACKS FOR ALL TREES ***************** */ -static void node_buts_group(uiLayout *layout, bContext *C, PointerRNA *ptr) +void node_buts_group(uiLayout *layout, bContext *C, PointerRNA *ptr) { - uiBlock *block= uiLayoutAbsoluteBlock(layout); - bNode *node= ptr->data; - rctf *butr= &node->butr; - - if(node->id) { - uiBut *bt; - short width; - - uiBlockBeginAlign(block); - - /* name button */ - width= (short)(butr->xmax-butr->xmin - (node->id->us>1?19.0f:0.0f)); - bt= uiDefBut(block, TEX, B_NOP, "NT:", - (short)butr->xmin, (short)butr->ymin, width, 19, - node->id->name+2, 0.0, 19.0, 0, 0, "NodeTree name"); - uiButSetFunc(bt, node_ID_title_cb, node, NULL); - - /* user amount */ - if(node->id->us>1) { - char str1[32]; - sprintf(str1, "%d", node->id->us); - bt= uiDefBut(block, BUT, B_NOP, str1, - (short)butr->xmax-19, (short)butr->ymin, 19, 19, - NULL, 0, 0, 0, 0, "Displays number of users."); - uiButSetFunc(bt, node_group_alone_cb, node, NULL); - } - - uiBlockEndAlign(block); - } + uiTemplateIDBrowse(layout, C, ptr, "nodetree", NULL, NULL, ""); } -#endif static void node_buts_value(uiLayout *layout, bContext *C, PointerRNA *ptr) { -- cgit v1.2.3