Blender Git Loki

Git Commits -> Revision 1e69a25

Revision 1e69a25 by Jacques Lucke (master)
August 30, 2021, 15:23 (GMT)
Nodes: add more flexible method to declare sockets of a node

Previously, built-in nodes had to implement "socket templates"
(`bNodeSocketTemplate`) to tell Blender which sockets they have.
It was nice that this was declarative, but this approach was way
too rigid and was cumbersome to use in many cases.

This commit starts to move us away from this rigid structure
by letting nodes implement a function that declares the sockets
the node has. Right now this is used as a direct replacement
of the "socket template" approach to keep the refactor smaller.
It's just a bit easier to read and write.

In the future we want to support more complex features like
dynamic numbers of sockets and type inferencing. Those features
will be easier to build on this new approach.

This new approach can live side by side with `bNodeSocketTemplate`
for a while. That makes it easier to update nodes one by one.

Note: In `bNodeSocketTemplate` socket identifiers were made
unique automatically. In this new approach, one has to specify
unique identifiers manually (unless the name is unique already).

Differential Revision: https://developer.blender.org/D12335

Commit Details:

Full Hash: 1e69a25043120cc8dddc3f58622eb50e1443def1
Parent Commit: e8684ef
Lines Changed: +1001, -143

4 Added Paths:

/source/blender/nodes/intern/node_declaration.cc (+65, -0) (View)
/source/blender/nodes/intern/node_socket_declarations.cc (+330, -0) (View)
/source/blender/nodes/NOD_node_declaration.hh (+135, -0) (View)
/source/blender/nodes/NOD_socket_declarations.hh (+239, -0) (View)

16 Modified Paths:

/source/blender/blenkernel/BKE_node.h (+10, -0) (Diff)
/source/blender/blenkernel/intern/node.cc (+18, -2) (Diff)
/source/blender/blenloader/intern/versioning_270.c (+2, -2) (Diff)
/source/blender/nodes/CMakeLists.txt (+4, -0) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_attribute_fill.cc (+17, -21) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc (+14, -18) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_edge_split.cc (+14, -22) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_input_material.cc (+8, -8) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_is_viewport.cc (+6, -6) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_circle.cc (+10, -15) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_cone.cc (+13, -18) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_object_info.cc (+12, -15) (Diff)
/source/blender/nodes/geometry/nodes/node_geo_transform.cc (+10, -14) (Diff)
/source/blender/nodes/geometry/node_geometry_util.hh (+1, -0) (Diff)
/source/blender/nodes/intern/node_socket.cc (+92, -1) (Diff)
/source/blender/nodes/NOD_socket.h (+1, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021