diff options
author | Charlie Jolly <charlie> | 2019-08-22 12:10:11 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-08-22 12:10:11 +0300 |
commit | 2ba233a31fead52820763fb6637dcae20eeed574 (patch) | |
tree | 9775141864615386c1e2c3d8a9e4712896505cb7 /source/blender/makesrna | |
parent | 0356c8f25b96bf9d8c677e51ad5106b5295cb37f (diff) |
Nodes: Support for socket shapes other than circle
Previously there was already "draw_shape" property,
but it was doing nothing. This commit renames the
property to "display_shape". Furthermore, different
shapes like SQUARE and DIAMOND are supported now.
Currently, the shapes are drawn using the shader that also
draws keyframes. In the future we might want to separate
this.
The new shapes are not used anywhere yet, but they can
be used by addon developers and will probably be useful
when we want to support different kinds node systems later.
For example, different shapes can be used to distinguish
between data and control flow.
Differential Revision: https://developer.blender.org/D2829
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index b7a2dd9a185..ea704fc4db2 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -63,10 +63,13 @@ const EnumPropertyItem rna_enum_node_socket_in_out_items[] = { {SOCK_IN, "IN", 0, "Input", ""}, {SOCK_OUT, "OUT", 0, "Output", ""}, {0, NULL, 0, NULL, NULL}}; #ifndef RNA_RUNTIME -static const EnumPropertyItem rna_enum_node_socket_draw_shape_items[] = { - {SOCK_DRAW_SHAPE_CIRCLE, "CIRCLE", 0, "Circle", ""}, - {SOCK_DRAW_SHAPE_SQUARE, "SQUARE", 0, "Square", ""}, - {SOCK_DRAW_SHAPE_DIAMOND, "DIAMOND", 0, "Diamond", ""}, +static const EnumPropertyItem rna_enum_node_socket_display_shape_items[] = { + {SOCK_DISPLAY_SHAPE_CIRCLE, "CIRCLE", 0, "Circle", ""}, + {SOCK_DISPLAY_SHAPE_SQUARE, "SQUARE", 0, "Square", ""}, + {SOCK_DISPLAY_SHAPE_DIAMOND, "DIAMOND", 0, "Diamond", ""}, + {SOCK_DISPLAY_SHAPE_CIRCLE_DOT, "CIRCLE_DOT", 0, "Circle with inner dot", ""}, + {SOCK_DISPLAY_SHAPE_SQUARE_DOT, "SQUARE_DOT", 0, "Square with inner dot", ""}, + {SOCK_DISPLAY_SHAPE_DIAMOND_DOT, "DIAMOND_DOT", 0, "Diamond with inner dot", ""}, {0, NULL, 0, NULL, NULL}}; static const EnumPropertyItem node_socket_type_items[] = { @@ -7858,10 +7861,10 @@ static void rna_def_node_socket(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", "Data type"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update"); - prop = RNA_def_property(srna, "draw_shape", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "draw_shape"); - RNA_def_property_enum_items(prop, rna_enum_node_socket_draw_shape_items); - RNA_def_property_enum_default(prop, SOCK_DRAW_SHAPE_CIRCLE); + prop = RNA_def_property(srna, "display_shape", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "display_shape"); + RNA_def_property_enum_items(prop, rna_enum_node_socket_display_shape_items); + RNA_def_property_enum_default(prop, SOCK_DISPLAY_SHAPE_CIRCLE); RNA_def_property_ui_text(prop, "Shape", "Socket shape"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update"); |