diff options
author | Fabian Schempp <fabian_schempp> | 2021-02-11 09:23:15 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-02-11 09:23:15 +0300 |
commit | 9a9e19fdcc48622dba8f98c9afb10a6750ff22b0 (patch) | |
tree | 43f7211319783f60439f77bba9b32227f63b4495 /source/blender/blenloader | |
parent | faad487b5825157cc953c54340647f71d3a06e9b (diff) |
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
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 25 |
1 files changed, 25 insertions, 0 deletions
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. * |