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>2013-05-28 22:10:00 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-05-28 22:10:00 +0400
commit3128a47d22ea7c6f85a3a133d86bd71aa6e9509d (patch)
tree9c50cfde4625dadcf66927576484f7fb50539105 /source/blender/editors/space_node/node_buttons.c
parent3223518e3297d76b7c21f1bb60f4df4b3133bcaf (diff)
Quick addition to the node sidebar "Active Node" panel: draw input socket values in addition to non-socket settings. This makes it possible to actually use the sidebar for all node settings without
having to go to the main area for changing socket values. This patch should be considered a temporary solution. The Active Node panel is a horrible mess and needs to be split up and cleaned. It should probably be moved to python as well.
Diffstat (limited to 'source/blender/editors/space_node/node_buttons.c')
-rw-r--r--source/blender/editors/space_node/node_buttons.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c
index 518bd6ea32b..2860bc93892 100644
--- a/source/blender/editors/space_node/node_buttons.c
+++ b/source/blender/editors/space_node/node_buttons.c
@@ -79,8 +79,10 @@ 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
+ bNodeSocket *sock;
uiLayout *layout, *row, *col, *sub;
PointerRNA ptr, opptr;
+ bool show_inputs;
/* verify pointers, and create RNA pointer for the node */
if (ELEM(NULL, ntree, node))
@@ -130,6 +132,33 @@ static void active_node_panel(const bContext *C, Panel *pa)
uiItemS(layout);
node->typeinfo->uifunc(layout, (bContext *)C, &ptr);
}
+
+ uiItemS(layout);
+
+ /* socket input values */
+ /* XXX this is not quite perfect yet, it still shows sockets without meaningful input values
+ * and does not yet use the socket link template - but better than nothing.
+ * Eventually could move this panel to python
+ * and leave it up to the individual node system implementation.
+ */
+ show_inputs = false;
+ for (sock = node->inputs.first; sock; sock = sock->next) {
+ if (!nodeSocketIsHidden(sock) && !(sock->flag & SOCK_IN_USE)) {
+ show_inputs = true;
+ break;
+ }
+ }
+ if (show_inputs) {
+ uiItemL(layout, "Inputs:", 0);
+ for (sock = node->inputs.first; sock; sock = sock->next) {
+ if (!nodeSocketIsHidden(sock) && !(sock->flag & SOCK_IN_USE)) {
+ uiLayout *row = uiLayoutRow(layout, false);
+ PointerRNA sock_ptr;
+ RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &sock_ptr);
+ sock->typeinfo->draw((bContext *)C, row, &sock_ptr, &ptr, sock->name);
+ }
+ }
+ }
}
static int node_sockets_poll(const bContext *C, PanelType *UNUSED(pt))