Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(549)

Issue 12245043: Patch: adding custom node socket shapes to the Node Editor

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by sjoerd_de_vries
Modified:
10 years, 9 months ago
Reviewers:
lukas.toenne1, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

Currently, node socket shapes are hard-coded as circles. This patch allows alternative shapes to be drawn, as controlled by a draw_shape() callback in a custom NodeSocket Python class. Defining this callback is optional. Draw_shape() takes the same arguments as draw_color(). It must return an enum. This patch defines this enum as "CIRCLE" (SOCK_SHAPE_CIRCLE) or "DIAMOND" (SOCK_SHAPE_DIAMOND). SOCK_SHAPE_CIRCLE is associated with the current drawing function. For SOCK_SHAPE_DIAMOND, a new drawing function has been added in space_node/node_draw.c. More shapes can easily be added later if desired. The definition of draw_shape() is optional. If it is not defined (NULL), a circle is drawn. Existing behavior is therefore maintained in all cases.

Patch Set 1 #

Total comments: 1

Patch Set 2 : patch v2, updated as per message #2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+138 lines, -9 lines) Patch
source/blender/blenkernel/BKE_node.h View 1 1 chunk +1 line, -0 lines 0 comments Download
source/blender/editors/space_node/drawnode.c View 4 chunks +4 lines, -1 line 0 comments Download
source/blender/editors/space_node/node_draw.c View 1 4 chunks +60 lines, -6 lines 0 comments Download
source/blender/editors/space_node/node_intern.h View 1 chunk +1 line, -1 line 0 comments Download
source/blender/makesdna/DNA_node_types.h View 1 chunk +6 lines, -0 lines 0 comments Download
source/blender/makesrna/intern/rna_nodetree.c View 1 7 chunks +66 lines, -1 line 0 comments Download

Messages

Total messages: 3
sjoerd_de_vries
10 years, 9 months ago (2013-08-01 11:03:25 UTC) #1
lukas.toenne1
https://codereview.appspot.com/12245043/diff/1/source/blender/makesrna/intern/rna_nodetree.c File source/blender/makesrna/intern/rna_nodetree.c (right): https://codereview.appspot.com/12245043/diff/1/source/blender/makesrna/intern/rna_nodetree.c#newcode2240 source/blender/makesrna/intern/rna_nodetree.c:2240: static void rna_NodeSocketStandard_draw_shape(ID *id, bNodeSocket *sock, struct bContext *C, ...
10 years, 9 months ago (2013-08-02 09:45:21 UTC) #2
sjoerd_de_vries
10 years, 9 months ago (2013-08-02 10:28:35 UTC) #3
patch v2, updated as per message #2
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b