[Bf-codereview] File output, node RNA and context changes (issue 5970073)

lukas.toenne at googlemail.com lukas.toenne at googlemail.com
Tue Apr 3 17:12:57 CEST 2012


Reviewers: bf-codereview_blender.org, brechtvl,

Description:
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.

Please review this at http://codereview.appspot.com/5970073/

Affected files:
   source/blender/blenkernel/BKE_node.h
   source/blender/blenloader/intern/readfile.c
   source/blender/editors/space_node/drawnode.c
   source/blender/editors/space_node/node_buttons.c
   source/blender/editors/space_node/node_draw.c
   source/blender/editors/space_node/node_edit.c
   source/blender/editors/space_node/node_intern.h
   source/blender/editors/space_node/node_ops.c
   source/blender/makesdna/DNA_node_types.h
   source/blender/makesrna/intern/rna_nodetree.c
   source/blender/nodes/composite/nodes/node_composite_outputFile.c




More information about the Bf-codereview mailing list