Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-01-13 19:00:20 +0300
committerHans Goudey <h.goudey@me.com>2021-01-13 19:00:20 +0300
commit80578a9d54fbff72065fddb5ac61bc9c0288aebd (patch)
tree11eea2a54b02f1509eab24b8c00753361a4003a5 /source/blender/blenloader
parent2771dfd5632ad6d982ee4bf3e87decdb197ebed7 (diff)
Geometry Nodes: Rename boolean input sockets
"Geometry A" becomes "Geometry 1", just to be more consistent with other nodes.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_290.c35
1 files changed, 35 insertions, 0 deletions
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;
+ }
}
}