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-02 11:18:51 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-02 11:18:51 +0400
commit01b3deb680f7e3b34adaad5b5a888e7bd44cfaa4 (patch)
treeb0462003b83e6d02a18fe6f541d04b0a52de260d /source/blender/editors/space_node/node_buttons.c
parent7f8643806da80831cb19ef46b4f424739e1c22f6 (diff)
A number of changes to node RNA and the file output node, to simplify socket types and make node code more robust for future nodes with extra socket data.
* Removed the struct_type identifier from sockets completely. Any specialization of socket types can be done by using separate collections in RNA and customized socket draw callbacks in node type. Sockets themselves are pure data inputs/outputs now. Possibly the sock->storage data could also be removed, but this will change anyway with id properties in custom nodes. * Replaced the direct socket button draw calls by extra callbacks in node types. This allows nodes to draw sockets in specialized ways without referring to the additional struct_type identifier. Default is simply drawing the socket default_value button, only file output node overrides this atm. * File output node slots now use a separate file sub-path in their storage data, instead of using the socket name. That way the path is an actual PROP_FILEPATH property and it works better with the UI list template (name property is local to the data struct). * Node draw contexts for options on the node itself and detail buttons in the sidebar now have an extra context pointer "node" (uiLayoutSetContextPointer). This can be used to bind operator buttons to a specific node, instead of having to rely on the active/selected node(s) or making weak links via node name. Compare to modifiers and logic bricks, they use the same feature. * Added another operator for reordering custom input slots in the file output node.
Diffstat (limited to 'source/blender/editors/space_node/node_buttons.c')
-rw-r--r--source/blender/editors/space_node/node_buttons.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c
index f7d517915da..c92abf116c4 100644
--- a/source/blender/editors/space_node/node_buttons.c
+++ b/source/blender/editors/space_node/node_buttons.c
@@ -89,7 +89,7 @@ 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= pa->layout;
+ uiLayout *layout;
PointerRNA ptr;
/* verify pointers, and create RNA pointer for the node */
@@ -100,6 +100,10 @@ static void active_node_panel(const bContext *C, Panel *pa)
//else
RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr);
+ /* XXX nicer way to make sub-layout? */
+ layout = uiLayoutColumn(pa->layout, 0);
+ uiLayoutSetContextPointer(layout, "node", &ptr);
+
/* draw this node's name, etc. */
uiItemR(layout, &ptr, "label", 0, NULL, ICON_NODE);
uiItemS(layout);