From 9a9e19fdcc48622dba8f98c9afb10a6750ff22b0 Mon Sep 17 00:00:00 2001 From: Fabian Schempp Date: Thu, 11 Feb 2021 00:23:15 -0600 Subject: Geometry Nodes: Use multi-input socket in join geometry node This updates the join node to use the new multi-input socket from D10067. The change just requires slightly changing the arguments of the exec function, and changing the socket input list. Note that this commit does not contain the UI changes, it only allows for more input links, and combines the two sockets into one. The UI changes will come next. Reviewed By: Hans Goudey Differential Revision: https://developer.blender.org/D10069 --- source/blender/blenloader/intern/versioning_290.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 8891197a7d9..78d60715aa5 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -735,6 +735,23 @@ static void version_node_socket_name(bNodeTree *ntree, } } +static void version_node_join_geometry_for_multi_input_socket(bNodeTree *ntree) +{ + LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &ntree->links) { + if (link->tonode->type == GEO_NODE_JOIN_GEOMETRY && !(link->tosock->flag & SOCK_MULTI_INPUT)) { + link->tosock = link->tonode->inputs.first; + } + } + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + if (node->type == GEO_NODE_JOIN_GEOMETRY) { + bNodeSocket *socket = node->inputs.first; + socket->flag |= SOCK_MULTI_INPUT; + socket->limit = 4095; + nodeRemoveSocket(ntree, node, socket->next); + } + } +} + /* NOLINTNEXTLINE: readability-function-size */ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) { @@ -1679,6 +1696,14 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 293, 7)) { + FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + if (ntree->type == NTREE_GEOMETRY) { + version_node_join_geometry_for_multi_input_socket(ntree); + } + } + FOREACH_NODETREE_END; + } /** * Versioning code until next subversion bump goes here. * -- cgit v1.2.3