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:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
commit53b01d90023a850b17ded5deb9cace354c8e298a (patch)
treeab8ce43ddf8046dc54e2cacc5ff46cbc5806910b /source/blender/editors/space_node/node_buttons.c
parent85923aff288da072750447b44e492ebe5c59bcce (diff)
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).
Diffstat (limited to 'source/blender/editors/space_node/node_buttons.c')
-rw-r--r--source/blender/editors/space_node/node_buttons.c18
1 files changed, 16 insertions, 2 deletions
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);