Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_common.cc
| Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | ||||
| if (node->type == node_type) { | if (node->type == node_type) { | ||||
| change_node_socket_name(&node->outputs, old_name, new_name); | change_node_socket_name(&node->outputs, old_name, new_name); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| bNodeSocket *version_node_add_socket_if_not_exist(bNodeTree *ntree, | |||||
| bNode *node, | |||||
| eNodeSocketInOut in_out, | |||||
| int type, | |||||
| int subtype, | |||||
| const char *identifier, | |||||
| const char *name) | |||||
| { | |||||
| bNodeSocket *sock = nodeFindSocket(node, in_out, identifier); | |||||
| if (sock != nullptr) { | |||||
| return sock; | |||||
| } | |||||
| return nodeAddStaticSocket(ntree, node, in_out, type, subtype, identifier, name); | |||||
| } | |||||
| /** | /** | ||||
| * Replace the ID name of all nodes in the tree with the given type with the new name. | * Replace the ID name of all nodes in the tree with the given type with the new name. | ||||
| */ | */ | ||||
| void version_node_id(bNodeTree *ntree, const int node_type, const char *new_name) | void version_node_id(bNodeTree *ntree, const int node_type, const char *new_name) | ||||
| { | { | ||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | ||||
| if (node->type == node_type) { | if (node->type == node_type) { | ||||
| if (!STREQ(node->idname, new_name)) { | if (!STREQ(node->idname, new_name)) { | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||