DescriptionCurrently, 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 #
MessagesTotal messages: 3
|