From 80578a9d54fbff72065fddb5ac61bc9c0288aebd Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 13 Jan 2021 10:00:20 -0600 Subject: Geometry Nodes: Rename boolean input sockets "Geometry A" becomes "Geometry 1", just to be more consistent with other nodes. --- source/blender/blenloader/intern/versioning_290.c | 35 +++++++++++++++++++++++ 1 file changed, 35 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 da57f8805b6..5cb94159ab2 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -708,6 +708,33 @@ static void do_versions_strip_cache_settings_recursive(const ListBase *seqbase) } } +static void version_node_socket_name(bNodeTree *ntree, + const int node_type, + const char *old_name, + const char *new_name) +{ + LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { + if (node->type == node_type) { + LISTBASE_FOREACH (bNodeSocket *, socket, &node->inputs) { + if (STREQ(socket->name, old_name)) { + strcpy(socket->name, new_name); + } + if (STREQ(socket->identifier, old_name)) { + strcpy(socket->identifier, new_name); + } + } + LISTBASE_FOREACH (bNodeSocket *, socket, &node->outputs) { + if (STREQ(socket->name, old_name)) { + strcpy(socket->name, new_name); + } + if (STREQ(socket->identifier, old_name)) { + strcpy(socket->identifier, new_name); + } + } + } + } +} + /* NOLINTNEXTLINE: readability-function-size */ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) { @@ -1545,5 +1572,13 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) */ { /* Keep this block, even when empty. */ + + FOREACH_NODETREE_BEGIN (bmain, ntree, id) { + if (ntree->type == NTREE_GEOMETRY) { + version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry A", "Geometry 1"); + version_node_socket_name(ntree, GEO_NODE_BOOLEAN, "Geometry B", "Geometry 2"); + } + FOREACH_NODETREE_END; + } } } -- cgit v1.2.3