diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 1 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_node_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 19 | ||||
-rw-r--r-- | source/blender/nodes/intern/node_socket.cc | 8 |
5 files changed, 39 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 180cced70ea..e639bb319a3 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -281,6 +281,7 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: break; } } @@ -373,6 +374,7 @@ static void write_node_socket_default_value(BlendWriter *writer, bNodeSocket *so case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: BLI_assert(false); break; } @@ -714,6 +716,7 @@ static void lib_link_node_socket(BlendLibReader *reader, Library *lib, bNodeSock case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: break; } } @@ -792,6 +795,7 @@ static void expand_node_socket(BlendExpander *expander, bNodeSocket *sock) case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: break; } } @@ -1348,6 +1352,7 @@ static void socket_id_user_increment(bNodeSocket *sock) case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: break; } } @@ -1374,6 +1379,7 @@ static void socket_id_user_decrement(bNodeSocket *sock) case __SOCK_MESH: case SOCK_CUSTOM: case SOCK_SHADER: + case SOCK_GEOMETRY: break; } } @@ -1501,6 +1507,8 @@ const char *nodeStaticSocketType(int type, int subtype) return "NodeSocketObject"; case SOCK_IMAGE: return "NodeSocketImage"; + case SOCK_GEOMETRY: + return "NodeSocketGeometry"; } return NULL; } @@ -1566,6 +1574,8 @@ const char *nodeStaticSocketInterfaceType(int type, int subtype) return "NodeSocketInterfaceObject"; case SOCK_IMAGE: return "NodeSocketInterfaceImage"; + case SOCK_GEOMETRY: + return "NodeSocketInterfaceGeometry"; } return NULL; } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index c8bdf4ec29c..0cd08404d19 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3333,6 +3333,7 @@ static const float std_node_socket_colors[][4] = { {0.39, 0.39, 0.39, 1.0}, /* SOCK_STRING */ {0.40, 0.10, 0.10, 1.0}, /* SOCK_OBJECT */ {0.10, 0.40, 0.10, 1.0}, /* SOCK_IMAGE */ + {0.00, 0.00, 0.00, 1.0}, /* SOCK_GEOMETRY, TODO: Choose color. */ }; /* common color callbacks for standard types */ diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index a5869a74ffc..fdae3559599 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -159,6 +159,7 @@ typedef enum eNodeSocketDatatype { SOCK_STRING = 7, SOCK_OBJECT = 8, SOCK_IMAGE = 9, + SOCK_GEOMETRY = 10, } eNodeSocketDatatype; /* socket shape */ diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index a9924c46fdd..67bb5e89254 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -84,6 +84,7 @@ static const EnumPropertyItem node_socket_type_items[] = { {SOCK_SHADER, "SHADER", 0, "Shader", ""}, {SOCK_OBJECT, "OBJECT", 0, "Object", ""}, {SOCK_IMAGE, "IMAGE", 0, "Image", ""}, + {SOCK_GEOMETRY, "GEOMETRY", 0, "Geometry", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -96,6 +97,7 @@ static const EnumPropertyItem node_socket_data_type_items[] = { {SOCK_RGBA, "RGBA", 0, "Color", ""}, {SOCK_OBJECT, "OBJECT", 0, "Object", ""}, {SOCK_IMAGE, "IMAGE", 0, "Image", ""}, + {SOCK_GEOMETRY, "GEOMETRY", 0, "Geometry", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -8829,6 +8831,21 @@ static void rna_def_node_socket_image(BlenderRNA *brna, RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocketInterface_update"); } +static void rna_def_node_socket_geometry(BlenderRNA *brna, + const char *identifier, + const char *interface_idname) +{ + StructRNA *srna; + + srna = RNA_def_struct(brna, identifier, "NodeSocketStandard"); + RNA_def_struct_ui_text(srna, "Geometry Node Socket", "Geometry socket of a node"); + RNA_def_struct_sdna(srna, "bNodeSocket"); + + srna = RNA_def_struct(brna, interface_idname, "NodeSocketInterfaceStandard"); + RNA_def_struct_ui_text(srna, "Geometry Node Socket Interface", "Geometry socket of a node"); + RNA_def_struct_sdna(srna, "bNodeSocket"); +} + static void rna_def_node_socket_standard_types(BlenderRNA *brna) { /* XXX Workaround: Registered functions are not exposed in python by bpy, @@ -8967,6 +8984,8 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) rna_def_node_socket_object(brna, "NodeSocketObject", "NodeSocketInterfaceObject"); rna_def_node_socket_image(brna, "NodeSocketImage", "NodeSocketInterfaceImage"); + + rna_def_node_socket_geometry(brna, "NodeSocketGeometry", "NodeSocketInterfaceGeometry"); } static void rna_def_internal_node(BlenderRNA *brna) diff --git a/source/blender/nodes/intern/node_socket.cc b/source/blender/nodes/intern/node_socket.cc index 2c4d7057b4e..b3803b20ac1 100644 --- a/source/blender/nodes/intern/node_socket.cc +++ b/source/blender/nodes/intern/node_socket.cc @@ -672,6 +672,12 @@ static bNodeSocketType *make_socket_type_object() return socktype; } +static bNodeSocketType *make_socket_type_geometry() +{ + bNodeSocketType *socktype = make_standard_socket_type(SOCK_GEOMETRY, PROP_NONE); + return socktype; +} + void register_standard_node_socket_types(void) { /* draw callbacks are set in drawnode.c to avoid bad-level calls */ @@ -708,5 +714,7 @@ void register_standard_node_socket_types(void) nodeRegisterSocketType(make_standard_socket_type(SOCK_IMAGE, PROP_NONE)); + nodeRegisterSocketType(make_socket_type_geometry()); + nodeRegisterSocketType(make_socket_type_virtual()); } |