[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57089] trunk/blender/source/blender/ editors/space_node/node_buttons.c: Quick addition to the node sidebar " Active Node" panel: draw input socket values in addition to non-socket settings.

Lukas Toenne lukas.toenne at googlemail.com
Tue May 28 20:10:00 CEST 2013


Revision: 57089
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57089
Author:   lukastoenne
Date:     2013-05-28 18:10:00 +0000 (Tue, 28 May 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/node_buttons.c

Modified: trunk/blender/source/blender/editors/space_node/node_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_buttons.c	2013-05-28 17:55:32 UTC (rev 57088)
+++ trunk/blender/source/blender/editors/space_node/node_buttons.c	2013-05-28 18:10:00 UTC (rev 57089)
@@ -79,8 +79,10 @@
 	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 @@
 		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))




More information about the Bf-blender-cvs mailing list