[Bf-codereview] Patch: custom display of NodeLinks in the Node Editor (issue 12660043)

sjdv1982 at gmail.com sjdv1982 at gmail.com
Thu Aug 8 13:41:26 CEST 2013


Reviewers: lukas.toenne1, bf-codereview_blender.org,

Description:
Currently, the display of NodeLinks in the Node Editor is mostly
hardcoded. A Bezier curve is drawn, starting and ending horizontally.
The curve is always solid and its color is determined by the global
theme, and cannot be customized for individual NodeLinks.

This patch adds four floats to the NodeLink, describing the initial and
final curve tangent. They can be accessed from RNA/Python using the
methods "get_initial_tangent", "set_initial_tangent",
"get_final_tangent" and "set_final_tangent". For a tangent that is all
zeroes, the current horizontal tangent is used.

This patch also adds two flags, "dashed" and "use_socket_color".
"dashed" draws the NodeLink curve in a dashed style. "use_socket_color"
invokes the "draw_color" method of the 'from' NodeSocket to get the
color of the curve.

On a technical note, the Bezier function signatures have been adapted to
accept a const bContext, and "const" has been added to the draw_color
function signature.

Please review this at https://codereview.appspot.com/12660043/

Affected files:
   source/blender/blenkernel/BKE_node.h
   source/blender/editors/space_node/drawnode.c
   source/blender/editors/space_node/node_draw.c
   source/blender/editors/space_node/node_intern.h
   source/blender/makesdna/DNA_node_types.h
   source/blender/makesrna/intern/rna_nodetree.c




More information about the Bf-codereview mailing list