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/blenkernel/BKE_node.h
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/blenkernel/BKE_node.h')
-rw-r--r--source/blender/blenkernel/BKE_node.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index a4eddd0b590..e7e1577c6b4 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -145,6 +145,9 @@ typedef struct bNodeType {
void (*uifunc)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr);
/// Additional parameters in the side panel.
void (*uifuncbut)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr);
+ /// Draw a node socket. Default draws the input value button.
+ NodeSocketButtonFunction drawinputfunc;
+ NodeSocketButtonFunction drawoutputfunc;
/// Optional custom label function for the node header.
const char *(*labelfunc)(struct bNode *);
/// Optional custom resize handle polling.