From 53b01d90023a850b17ded5deb9cace354c8e298a Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Tue, 22 May 2012 14:13:33 +0000 Subject: A number of new features for the node editor in general and the Frame node in particular. For an detailed user-level description of new features see the following blogpost: http://code.blender.org/index.php/2012/05/node-editing-tweaks/ TL;DR: * Frame node gets more usable bounding-box behavior * Node resizing has helpful mouse cursor indicators and works on all borders * Node selection/active colors are themeable independently * Customizable background colors for nodes (useful for frames visual distinction). --- source/blender/editors/space_node/node_buttons.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_node/node_buttons.c') diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index c92abf116c4..16810e0fdec 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -89,8 +89,8 @@ static void active_node_panel(const bContext *C, Panel *pa) SpaceNode *snode= CTX_wm_space_node(C); bNodeTree *ntree= (snode) ? snode->edittree : NULL; bNode *node = (ntree) ? nodeGetActive(ntree) : NULL; // xxx... for editing group nodes - uiLayout *layout; - PointerRNA ptr; + uiLayout *layout, *row, *col; + PointerRNA ptr, opptr; /* verify pointers, and create RNA pointer for the node */ if (ELEM(NULL, ntree, node)) @@ -113,6 +113,20 @@ static void active_node_panel(const bContext *C, Panel *pa) uiItemO(layout, NULL, 0, "NODE_OT_hide_socket_toggle"); uiItemS(layout); + row = uiLayoutRow(layout, 0); + uiItemM(row, (bContext *)C, "NODE_MT_node_color_presets", NULL, 0); + uiItemM(row, (bContext *)C, "NODE_MT_node_color_specials", "", ICON_DOWNARROW_HLT); + uiItemO(row, "", ICON_ZOOMIN, "node.node_color_preset_add"); + opptr = uiItemFullO(row, "node.node_color_preset_add", "", ICON_ZOOMOUT, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS); + RNA_boolean_set(&opptr, "remove_active", 1); + + row = uiLayoutRow(layout, 0); + uiItemR(row, &ptr, "use_custom_color", UI_ITEM_R_ICON_ONLY, NULL, ICON_NONE); + col = uiLayoutColumn(row, 0); + if (!(node->flag & NODE_CUSTOM_COLOR)) + uiLayoutSetEnabled(col, 0); + uiItemR(col, &ptr, "color", 0, "", 0); + /* draw this node's settings */ if (node->typeinfo && node->typeinfo->uifuncbut) node->typeinfo->uifuncbut(layout, (bContext *)C, &ptr); -- cgit v1.2.3